File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed
Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 1111 TYPE_CHECKING ,
1212 Any ,
1313 Callable ,
14- Dict ,
1514 List ,
1615 MutableMapping ,
1716 MutableSequence ,
Original file line number Diff line number Diff line change 1+ # SPDX-License-Identifier: Apache-2.0
2+ """Test that scoping of identifiers in Workflow.steps[].run is correct."""
3+
4+ from pathlib import Path
5+
6+ from cwl_utils .parser import Workflow , load_document_by_uri
7+
8+ HERE = Path (__file__ ).resolve ().parent
9+
10+
11+ def test_workflow_step_process_scope_v1_0 () -> None :
12+ """CWL v1.0 IDs under Workflow.steps[].run should not be scoped in the "run" scope."""
13+ uri = Path (HERE / "../testdata/workflow_input_format_expr.cwl" ).resolve ().as_uri ()
14+ cwl_obj : Workflow = load_document_by_uri (uri )
15+ assert cwl_obj .steps [0 ].run .inputs [0 ].id .endswith ("#format_extract/target" )
16+
17+
18+ def test_workflow_step_process_scope_v1_1 () -> None :
19+ """CWL v1.1 IDs under Workflow.steps[].run should be scoped in the "run" scope."""
20+ uri = (
21+ Path (HERE / "../testdata/workflow_input_format_expr_v1_1.cwl" )
22+ .resolve ()
23+ .as_uri ()
24+ )
25+ cwl_obj : Workflow = load_document_by_uri (uri )
26+ assert cwl_obj .steps [0 ].run .inputs [0 ].id .endswith ("#format_extract/run/target" )
27+
28+
29+ def test_workflow_step_process_scope_v1_2 () -> None :
30+ """CWL v1.2 IDs under Workflow.steps[].run should be scoped in the "run" scope."""
31+ uri = (
32+ Path (HERE / "../testdata/workflow_input_format_expr_v1_2.cwl" )
33+ .resolve ()
34+ .as_uri ()
35+ )
36+ cwl_obj : Workflow = load_document_by_uri (uri )
37+ assert cwl_obj .steps [0 ].run .inputs [0 ].id .endswith ("#format_extract/run/target" )
You can’t perform that action at this time.
0 commit comments