hpcflow.sdk.core.test_utils.command_line_test#
- hpcflow.sdk.core.test_utils.command_line_test(cmd_str, expected, inputs, path, outputs=None, cmd_stdout=None, shell_args=None, schema_inputs=None)#
Utility function for testing Command.get_command_line in various scenarios, via a single-action, single-command workflow.
The functions asserts that the generated command line based on cmd_str is equal to the provided expected command line.
- Parameters:
cmd_str (str) – The command string to test.
expected (str) – The resolved commandline string that should be generated.
inputs (dict[str, Any] | list[InputValue]) – Either a dictionary mapping string input names to values, or a list of InputValue objects.
path (Path) – The path to use to create the workflow during the test.
outputs (Sequence[str] | None) – List of string output names.
cmd_stdout (str | None) – The Command object’s stdout attribute.
shell_args (tuple[str, str] | None) – Tuple of shell name and os name, used to select which Shell to instantiate.
schema_inputs (list[Parameter | SchemaInput] | None) – List of SchemaInput objects to use. If not passed, simple schema inputs will be generated.