Skip to content

Commit 6efcc8e

Browse files
author
Vasu Jaganath
committed
modify test2D to automate file creation
1 parent 6f313a5 commit 6efcc8e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

cwltool/command_line_tool.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1497,14 +1497,16 @@ def collect_output(
14971497
else:
14981498

14991499
def recursively_insert(j_dict: Any, key: Any, val: Any) -> Any:
1500-
"""Recursively inserts a value into any dictionaries"""
1500+
"""Recursively insert a value into any dictionary."""
15011501
if isinstance(j_dict, List):
15021502
return [recursively_insert(x, key, val) for x in j_dict]
15031503
if isinstance(j_dict, Dict):
15041504
if j_dict.get("class") == "File":
15051505
j_dict[key] = val
15061506
else:
1507-
return {x: recursively_insert(y, key, val) for x, y in j_dict.items()}
1507+
return {
1508+
x: recursively_insert(y, key, val) for x, y in j_dict.items()
1509+
}
15081510
return j_dict
15091511

15101512
result = recursively_insert(result, "format", format_field)

tests/test_2D.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
import subprocess
22
import sys
3+
from pathlib import Path
34

45
from .util import get_data
56

67

78
def test_output_2D_file_format() -> None:
8-
"""Test format tag for 2D output arrays."""
9+
"""A simple test for format tag fix for 2D output arrays."""
910

11+
Path("filename.txt").touch()
1012
params = [
1113
sys.executable,
1214
"-m",
1315
"cwltool",
16+
"--cachedir", # just so that the relative path of file works out
17+
"foo",
1418
get_data("tests/output_2D_file_format.cwl"),
1519
]
1620

0 commit comments

Comments
 (0)