Testing¶
testing
¶
Public testing utilities for flepimop2.
external_provider_package(parent_directory, copy_files=None, dependencies=None, project_name='example-provider', project_requires_python='>=3.11')
¶
Set up an external provider package and install it into a fresh venv.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent_directory
|
Path
|
Directory in which to set up the provider package and venv. |
required |
copy_files
|
dict[Path, Path] | None
|
Optional mapping of source files to destination paths
within |
None
|
dependencies
|
list[str] | None
|
Optional list of dependencies to include in the provider
package. If omitted, defaults to |
None
|
project_name
|
str
|
Optional name for the provider package. Defaults to "example-provider". |
'example-provider'
|
project_requires_python
|
str
|
Optional Python version specifier for the provider package. Defaults to ">=3.11". |
'>=3.11'
|
Returns:
| Type | Description |
|---|---|
str
|
The python executable path from the newly created venv. |
Source code in src/flepimop2/testing.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | |
flepimop2_run(action, args=None, cwd=None)
¶
Run a flepimop2 CLI command via subprocess.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
str
|
CLI action name (e.g. "process", "simulate", etc). For a full list of
available actions, see |
required |
args
|
list[str] | None
|
Additional command arguments to pass to the CLI command. |
None
|
cwd
|
Path | None
|
Optional working directory for the command. |
None
|
Returns:
| Type | Description |
|---|---|
CompletedProcess[str]
|
The completed process from running the CLI. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the action is empty. |
Source code in src/flepimop2/testing.py
project_skeleton(parent_directory, copy_files=None, dependencies=None)
¶
Create a project skeleton in parent_directory and optionally copy files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent_directory
|
Path
|
Directory in which to create the project skeleton and venv. |
required |
copy_files
|
dict[Path, Path] | None
|
Optional mapping of source files to destination paths
within |
None
|
dependencies
|
list[str] | None
|
Optional list of dependencies to install into the venv. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
The python executable path from the newly created venv. |