Skip to content

Commit

Permalink
modify test2D to automate file creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasu Jaganath committed Jun 27, 2024
1 parent f201b2a commit a2045cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cwltool/command_line_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,9 @@ def recursively_insert(j_dict: Any, key: Any, val: Any) -> Any:
if j_dict.get("class") == "File":
j_dict[key] = val
else:
return {x: recursively_insert(y, key, val) for x, y in j_dict.items()}
return {

Check warning on line 1507 in cwltool/command_line_tool.py

View check run for this annotation

Codecov / codecov/patch

cwltool/command_line_tool.py#L1507

Added line #L1507 was not covered by tests
x: recursively_insert(y, key, val) for x, y in j_dict.items()
}
return j_dict

result = recursively_insert(result, "format", format_field)
Expand Down
4 changes: 4 additions & 0 deletions tests/test_2D.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import subprocess
import sys
from pathlib import Path

from .util import get_data


def test_output_2D_file_format() -> None:
"""Test format tag for 2D output arrays."""

Path("filename.txt").touch()
params = [
sys.executable,
"-m",
"cwltool",
"--cachedir", # just so that the relative path of file works out
"foo",
get_data("tests/output_2D_file_format.cwl"),
]

Expand Down

0 comments on commit a2045cb

Please sign in to comment.