Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cwltool/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
Sized,
TextIO,
Tuple,
TypeVar,
Union,
cast,
)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion cwltool/singularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tests/test_cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
9 changes: 9 additions & 0 deletions tests/test_make_template.py
Original file line number Diff line number Diff line change
@@ -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.")
4 changes: 0 additions & 4 deletions tests/test_relocate.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down