diff --git a/cwltool/main.py b/cwltool/main.py index 2770d503b..6eaf2b642 100755 --- a/cwltool/main.py +++ b/cwltool/main.py @@ -29,7 +29,6 @@ Sized, TextIO, Tuple, - TypeVar, Union, cast, ) @@ -230,6 +229,8 @@ def generate_example_input( example = ruamel.yaml.comments.CommentedMap() if "name" in inptype: comment = '"{}" record type.'.format(inptype["name"]) + else: + comment = "Anonymous record type." for field in cast(List[CWLObjectType], inptype["fields"]): value, f_comment = generate_example_input(field["type"], None) example.insert(0, shortname(cast(str, field["name"])), value, f_comment) diff --git a/cwltool/singularity.py b/cwltool/singularity.py index 70eb72fe3..7d4d5b66a 100644 --- a/cwltool/singularity.py +++ b/cwltool/singularity.py @@ -13,7 +13,6 @@ from .builder import Builder from .context import RuntimeContext -from .cuda import cuda_check from .errors import WorkflowException from .job import ContainerCommandLineJob from .loghandler import _logger diff --git a/tests/test_cuda.py b/tests/test_cuda.py index a736b8917..75ba1eac7 100644 --- a/tests/test_cuda.py +++ b/tests/test_cuda.py @@ -2,8 +2,6 @@ from cwltool.main import main from .util import ( get_data, - get_main_output, - get_tool_env, needs_docker, needs_singularity_3_or_newer, ) diff --git a/tests/test_make_template.py b/tests/test_make_template.py new file mode 100644 index 000000000..6c173cf9e --- /dev/null +++ b/tests/test_make_template.py @@ -0,0 +1,9 @@ +"""Tests for --make-template.""" + +from schema_salad.sourceline import cmap +from cwltool import main + + +def test_anonymous_record() -> None: + inputs = cmap([{"type": "record", "fields": []}]) + assert main.generate_example_input(inputs, None) == ({}, "Anonymous record type.") diff --git a/tests/test_relocate.py b/tests/test_relocate.py index 3b3930433..5aa189994 100644 --- a/tests/test_relocate.py +++ b/tests/test_relocate.py @@ -1,12 +1,8 @@ import json import sys from pathlib import Path -import tempfile from cwltool.main import main -from cwltool.process import relocateOutputs -from cwltool.stdfsaccess import StdFsAccess -from cwltool.pathmapper import PathMapper from .util import get_data, needs_docker