diff --git a/tests/test-data/conformance_test_v1.2.cwltest.yaml b/tests/test-data/conformance_test_v1.2.cwltest.yaml index 0b78da9..207aaa6 100644 --- a/tests/test-data/conformance_test_v1.2.cwltest.yaml +++ b/tests/test-data/conformance_test_v1.2.cwltest.yaml @@ -12,4 +12,10 @@ tool: v1.0/cat1-testcli.cwl id: cl_optional_bindings_provided doc: Test command line with optional input (provided) - tags: [ command_line_tool ] \ No newline at end of file + tags: [ command_line_tool ] + +- tool: v1.0/null-expression2-tool.cwl + should_fail: true + id: expression_any_nodefaultany + doc: Test Any without defaults cannot be unspecified. + tags: [ inline_javascript, expression_tool ] diff --git a/tests/test-data/v1.0/null-expression2-tool.cwl b/tests/test-data/v1.0/null-expression2-tool.cwl new file mode 100644 index 0000000..2b09ec0 --- /dev/null +++ b/tests/test-data/v1.0/null-expression2-tool.cwl @@ -0,0 +1,14 @@ +#!/usr/bin/env cwl-runner + +class: ExpressionTool +requirements: + - class: InlineJavascriptRequirement +cwlVersion: v1.2 + +inputs: + i1: Any + +outputs: + output: int + +expression: "$({'output': (inputs.i1 == 'the-default' ? 1 : 2)})" \ No newline at end of file diff --git a/tests/test_badgedir.py b/tests/test_badgedir.py index 45ed161..3c5ccfb 100644 --- a/tests/test_badgedir.py +++ b/tests/test_badgedir.py @@ -36,9 +36,6 @@ def test_badgedir(tmp_path: Path) -> None: assert obj.get("color", "") == "red" required_md = badgedir / "required.md" - import sys - - print(f"dir: `{required_md}`", file=sys.stderr) assert required_md.exists() with open(required_md) as file: s = file.read() @@ -116,3 +113,14 @@ def test_badgedir_with_baseuri(tmp_path: Path) -> None: f"- [cl_optional_bindings_provided](https://example.com/specified/uri/conformance_test_v1.2.cwltest.yaml#L8) ([tool](https://example.com/specified/uri/v1.0/cat1-testcli.cwl), [job](https://example.com/specified/uri/v1.0/cat-n-job.json)){n}" # NOQA f"## List of unsupported tests{n}" ) == file.read() + + js_md = badgedir / "inline_javascript.md" + assert js_md.exists() + with open(js_md) as file: + assert ( + f"# `inline_javascript` tests{n}" + f"## List of passed tests{n}" + f"- [expression_any_nodefaultany](https://example.com/specified/uri/conformance_test_v1.2.cwltest.yaml#L16) ([tool](https://example.com/specified/uri/v1.0/null-expression2-tool.cwl)){n}" # NOQA + f"## List of failed tests{n}" + f"## List of unsupported tests{n}" + ) == file.read() diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 4951c3f..6196426 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -104,7 +104,7 @@ def test_no_label(pytester: "Pytester") -> None: result = pytester.runpytest( "-k", "conformance_test_v1.2.cwltest.yaml", "--cwl-tags", "required" ) - result.assert_outcomes(passed=1, skipped=1) + result.assert_outcomes(passed=1, skipped=2) def test_cwltool_hook(pytester: "Pytester") -> None: