diff --git a/.gitignore b/.gitignore index 5941627f8..fbe4b24fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # Generated during tests pytestdebug.log tmp/ +*.sif +involucro # Python temps __pycache__/ @@ -59,4 +61,3 @@ cwltool/_version.py cwltool_deps docs/_build/ docs/autoapi/ - diff --git a/tests/test_load_contents.py b/tests/test_load_contents.py new file mode 100644 index 000000000..fbbeb88fc --- /dev/null +++ b/tests/test_load_contents.py @@ -0,0 +1,20 @@ +"""Test the loadContents feature.""" +import json +from pathlib import Path + +from cwltool.main import main + +from .util import get_data + + +def test_load_contents_file_array(tmp_path: Path) -> None: + """Ensures that a File[] input with loadContents loads each file.""" + params = [ + "--outdir", str(tmp_path), + get_data("tests/load_contents-array.cwl"), + "tests/load_contents-array.yml", + ] + assert main(params) == 0 + with open(tmp_path / "data.json") as out_fd: + data = json.load(out_fd) + assert data == {"data": [1, 2]}