diff --git a/cwltool/context.py b/cwltool/context.py index 2fc1f0e2e..090486a26 100644 --- a/cwltool/context.py +++ b/cwltool/context.py @@ -127,7 +127,7 @@ def __init__(self, kwargs: Optional[Dict[str, Any]] = None) -> None: self.basedir = "" # type: str self.toplevel = False # type: bool self.mutation_manager = None # type: Optional[MutationManager] - self.make_fs_access = StdFsAccess # type: Callable[[str], StdFsAccess] + self.make_fs_access = StdFsAccess self.path_mapper = PathMapper self.builder = None # type: Optional[Builder] self.docker_outdir = "" # type: str diff --git a/cwltool/process.py b/cwltool/process.py index fa2338d3a..6b4bda5ed 100644 --- a/cwltool/process.py +++ b/cwltool/process.py @@ -1074,6 +1074,10 @@ def job( ) -> JobsGeneratorType: pass + def __str__(self) -> str: + """Return the id of this CWL process.""" + return f"{type(self).__name__}: {self.tool['id']}" + _names = set() # type: Set[str] diff --git a/tests/test_examples.py b/tests/test_examples.py index 13cbfd147..0285cec97 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -1574,3 +1574,27 @@ def test_custom_type_in_step_process() -> None: ] ) assert err_code == 0 + + +def test_expression_tool_class() -> None: + """Confirm properties of the ExpressionTool class.""" + factory = cwltool.factory.Factory() + tool_path = get_data("tests/wf/parseInt-tool.cwl") + expression_tool = factory.make(tool_path).t + assert str(expression_tool) == f"ExpressionTool: file://{tool_path}" + + +def test_operation_class() -> None: + """Confirm properties of the AbstractOperation class.""" + factory = cwltool.factory.Factory() + tool_path = get_data("tests/wf/operation/abstract-cosifer.cwl") + expression_tool = factory.make(tool_path).t + assert str(expression_tool) == f"AbstractOperation: file://{tool_path}" + + +def test_command_line_tool_class() -> None: + """Confirm properties of the CommandLineTool class.""" + factory = cwltool.factory.Factory() + tool_path = get_data("tests/echo.cwl") + expression_tool = factory.make(tool_path).t + assert str(expression_tool) == f"CommandLineTool: file://{tool_path}"