Skip to content

Commit 23c5ce0

Browse files
committed
add pytest for loadContents File[]
1 parent feeb0be commit 23c5ce0

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Generated during tests
22
pytestdebug.log
33
tmp/
4+
*.sif
5+
involucro
46

57
# Python temps
68
__pycache__/
@@ -59,4 +61,3 @@ cwltool/_version.py
5961
cwltool_deps
6062
docs/_build/
6163
docs/autoapi/
62-

tests/test_load_contents.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""Test the loadContents feature."""
2+
import json
3+
from pathlib import Path
4+
5+
from cwltool.main import main
6+
7+
from .util import get_data
8+
9+
10+
def test_load_contents_file_array(tmp_path: Path) -> None:
11+
"""Ensures that a File[] input with loadContents loads each file."""
12+
params = [
13+
"--outdir", str(tmp_path),
14+
get_data("tests/load_contents-array.cwl"),
15+
"tests/load_contents-array.yml",
16+
]
17+
assert main(params) == 0
18+
with open(tmp_path / "data.json") as out_fd:
19+
data = json.load(out_fd)
20+
assert data == {"data": [1, 2]}

0 commit comments

Comments
 (0)