@@ -109,6 +109,27 @@ def test_validate_shortcut_example_1():
109
109
assert error .error_msg is None
110
110
111
111
112
+ def test_validate_simple_python_parallel ():
113
+ # Arrange
114
+ workflow_file : str = os .path .join (
115
+ os .path .dirname (__file__ ),
116
+ "workflow-definitions" ,
117
+ "simple-python-parallel.yaml" ,
118
+ )
119
+ with open (workflow_file , "r" , encoding = "utf8" ) as workflow_file :
120
+ workflow : dict [str , Any ] = yaml .load (workflow_file , Loader = yaml .FullLoader )
121
+ assert workflow
122
+
123
+ # Act
124
+ error = WorkflowValidator .validate (
125
+ level = ValidationLevel .TAG ,
126
+ workflow_definition = workflow ,
127
+ )
128
+
129
+ # Assert
130
+ assert error .error_num == 0
131
+
132
+
112
133
def test_validate_simple_python_molprops ():
113
134
# Arrange
114
135
workflow_file : str = os .path .join (
@@ -171,3 +192,51 @@ def test_validate_duplicate_workflow_variable_names():
171
192
# Assert
172
193
assert error .error_num == 6
173
194
assert error .error_msg == ["Duplicate workflow variable names found: x" ]
195
+
196
+
197
+ def test_validate_replicate_using_undeclared_input ():
198
+ # Arrange
199
+ workflow_file : str = os .path .join (
200
+ os .path .dirname (__file__ ),
201
+ "workflow-definitions" ,
202
+ "replicate-using-undeclared-input.yaml" ,
203
+ )
204
+ with open (workflow_file , "r" , encoding = "utf8" ) as workflow_file :
205
+ workflow : dict [str , Any ] = yaml .load (workflow_file , Loader = yaml .FullLoader )
206
+ assert workflow
207
+
208
+ # Act
209
+ error = WorkflowValidator .validate (
210
+ level = ValidationLevel .TAG ,
211
+ workflow_definition = workflow ,
212
+ )
213
+
214
+ # Assert
215
+ assert error .error_num == 7
216
+ assert error .error_msg == [
217
+ "Replicate input variable is not declared: y (step=step-2)"
218
+ ]
219
+
220
+
221
+ def test_validate_duplicate_step_output_variable_names ():
222
+ # Arrange
223
+ workflow_file : str = os .path .join (
224
+ os .path .dirname (__file__ ),
225
+ "workflow-definitions" ,
226
+ "duplicate-step-output-variable-names.yaml" ,
227
+ )
228
+ with open (workflow_file , "r" , encoding = "utf8" ) as workflow_file :
229
+ workflow : dict [str , Any ] = yaml .load (workflow_file , Loader = yaml .FullLoader )
230
+ assert workflow
231
+
232
+ # Act
233
+ error = WorkflowValidator .validate (
234
+ level = ValidationLevel .TAG ,
235
+ workflow_definition = workflow ,
236
+ )
237
+
238
+ # Assert
239
+ assert error .error_num == 3
240
+ assert error .error_msg == [
241
+ "Duplicate step output variable: outputFile (step=step-1)"
242
+ ]
0 commit comments