@@ -133,8 +133,54 @@ def test_check_format_no_ontology() -> None:
133
133
)
134
134
135
135
136
- def test_loading_options_graph_property () -> None :
137
- """Test that RDFLib Graph representations of $schema properties are correctly loaded."""
136
+ def test_loading_options_graph_property_v1_0 () -> None :
137
+ """Test that RDFLib Graph representations of $schema properties are correctly loaded, CWL v1.0."""
138
+ uri = Path (HERE / "../testdata/formattest2_v1_0.cwl" ).resolve ().as_uri ()
139
+ cwl_obj = load_document_by_uri (uri )
140
+ assert to_isomorphic (cwl_obj .loadingOptions .graph ) == to_isomorphic (EDAM )
141
+
142
+
143
+ def test_loading_options_graph_property_v1_1 () -> None :
144
+ """Test that RDFLib Graph representations of $schema properties are correctly loaded, CWL v1.1."""
145
+ uri = Path (HERE / "../testdata/formattest2_v1_1.cwl" ).resolve ().as_uri ()
146
+ cwl_obj = load_document_by_uri (uri )
147
+ assert to_isomorphic (cwl_obj .loadingOptions .graph ) == to_isomorphic (EDAM )
148
+
149
+
150
+ def test_loading_options_graph_property_v1_2 () -> None :
151
+ """Test that RDFLib Graph representations of $schema properties are correctly loaded, CWL v1.2."""
138
152
uri = Path (HERE / "../testdata/formattest2.cwl" ).resolve ().as_uri ()
139
153
cwl_obj = load_document_by_uri (uri )
140
154
assert to_isomorphic (cwl_obj .loadingOptions .graph ) == to_isomorphic (EDAM )
155
+
156
+
157
+ def test_loading_options_missing_graph_v1_0 () -> None :
158
+ """Affirm that v1.0 documents without $schema still produce an empty graph property."""
159
+ uri = Path (HERE / "../testdata/workflow_input_format_expr.cwl" ).resolve ().as_uri ()
160
+ cwl_obj = load_document_by_uri (uri )
161
+ assert to_isomorphic (cwl_obj .loadingOptions .graph ) == to_isomorphic (Graph ())
162
+ assert to_isomorphic (cwl_obj .loadingOptions .graph ) == to_isomorphic (Graph ())
163
+
164
+
165
+ def test_loading_options_missing_graph_v1_1 () -> None :
166
+ """Affirm that v1.1 documents without $schema still produce an empty graph property."""
167
+ uri = (
168
+ Path (HERE / "../testdata/workflow_input_format_expr_v1_1.cwl" )
169
+ .resolve ()
170
+ .as_uri ()
171
+ )
172
+ cwl_obj = load_document_by_uri (uri )
173
+ assert to_isomorphic (cwl_obj .loadingOptions .graph ) == to_isomorphic (Graph ())
174
+ assert to_isomorphic (cwl_obj .loadingOptions .graph ) == to_isomorphic (Graph ())
175
+
176
+
177
+ def test_loading_options_missing_graph_v1_2 () -> None :
178
+ """Affirm that v1.2 documents without $schema still produce an empty graph property."""
179
+ uri = (
180
+ Path (HERE / "../testdata/workflow_input_format_expr_v1_2.cwl" )
181
+ .resolve ()
182
+ .as_uri ()
183
+ )
184
+ cwl_obj = load_document_by_uri (uri )
185
+ assert to_isomorphic (cwl_obj .loadingOptions .graph ) == to_isomorphic (Graph ())
186
+ assert to_isomorphic (cwl_obj .loadingOptions .graph ) == to_isomorphic (Graph ())
0 commit comments