pytest_wdl.providers package

Submodules

pytest_wdl.providers.dx module

class pytest_wdl.providers.dx.DxInputsFormatter(wdl_doc: WDL.Tree.Document, project_id: str = None, data_project_id: Optional[str] = None, folder: str = '/', data_folder: Optional[str] = None, **_)[source]

Bases: object

format_inputs(inputs_dict: dict, namespace: Optional[str] = None) → dict[source]
format_value(value: Any, path: Tuple[str, ...], nested: bool = False) → Tuple[Any, bool][source]

Convert a primitive, DataFile, Sequence, or Dict to a JSON-serializable object. Currently, arbitrary objects can be serialized by implementing an as_dict() method, otherwise they are converted to strings.

Parameters
  • value – The value to format.

  • path – The path to the current value.

  • nested – Whether the value is nested within a complex type

Returns

The tuple (val, is_complex), where val is serializable value and is_complex is True if the value is a complex type.

class pytest_wdl.providers.dx.DxResponse(file_id: str, project_id: Optional[str] = None)[source]

Bases: pytest_wdl.url_schemes.Response

download_file(destination: pathlib.Path, show_progress: bool = False, digests: Optional[dict] = None)[source]

Download a file to a specific destination.

Parameters
  • destination – Destination path

  • show_progress – Whether to show a progress bar

  • digests – Optional dict mapping hash names to digests. These are used to validate the downloaded file.

Raises

DigestsNotEqualError

class pytest_wdl.providers.dx.DxUrlHandler[source]

Bases: pytest_wdl.url_schemes.UrlHandler

property handles
property scheme
urlopen(request: urllib.request.Request) → pytest_wdl.url_schemes.Response[source]
class pytest_wdl.providers.dx.DxWdlExecutor(import_dirs: Optional[Sequence[pathlib.Path]] = None, java_bin: Union[str, pathlib.Path, None] = None, java_args: Optional[str] = None, dxwdl_jar_file: Union[str, pathlib.Path, None] = None, dxwdl_cache_dir: Union[str, pathlib.Path, None] = None)[source]

Bases: pytest_wdl.executors.JavaExecutor

run_workflow(wdl_path: pathlib.Path, inputs: Optional[dict] = None, expected: Optional[dict] = None, **kwargs) → dict[source]

Run a WDL workflow on given inputs, and check that the output matches given expected values.

Parameters
  • wdl_path – The WDL script to execute.

  • inputs – Object that will be serialized to JSON and provided to Cromwell as the workflow inputs.

  • expected – Dict mapping output parameter names to expected values.

  • kwargs – Additional executor-specific keyword arguments (mostly for debugging)

Returns

Dict of outputs.

Raises
  • ExecutionFailedError – if there was an error executing the workflow

  • AssertionError – if the actual outputs don’t match the expected outputs

pytest_wdl.providers.dx.login(logout: bool = False, interactive: bool = True)[source]

Checks that the user is logged into DNAnexus, otherwise log them in.

Parameters
  • logout – Whether to log out before exiting the context. Ignored if the user is already logged in.

  • interactive – Whether to allow interactive login.

Raises

PluginError – if interactive is False and the user cannot be logged in non-interactively

Module contents