@@ -399,3 +399,52 @@ def test_workflow_engine_simple_python_molprops_with_options(basic_engine):
399
399
# This test should generate a file in the simulated project directory
400
400
assert project_file_exists (output_file_1 )
401
401
assert project_file_exists (output_file_2 )
402
+
403
+
404
+ def test_workflow_engine_simple_python_parallel (basic_engine ):
405
+ # Arrange
406
+ da , md = basic_engine
407
+ # Make sure files that should be generated by the test
408
+ # do not exist before we run the test.
409
+ output_file_first = "first-step.out.smi"
410
+ assert not project_file_exists (output_file_first )
411
+ output_file_pa = "parallel-step-a.out.smi"
412
+ assert not project_file_exists (output_file_pa )
413
+ output_file_pb = "parallel-step-b.out.smi"
414
+ assert not project_file_exists (output_file_pb )
415
+ output_file_final = "final-step.out.smi"
416
+ assert not project_file_exists (output_file_final )
417
+ # And create the test's input file.
418
+ input_file_1 = "input1.smi"
419
+ input_file_1_content = "O=C(CSCc1ccc(Cl)s1)N1CCC(O)CC1"
420
+ with open (
421
+ f"{ EXECUTION_DIRECTORY } /{ input_file_1 } " , mode = "wt" , encoding = "utf8"
422
+ ) as input_file :
423
+ input_file .writelines (input_file_1_content )
424
+
425
+ # Act
426
+ r_wfid = start_workflow (
427
+ md ,
428
+ da ,
429
+ "simple-python-parallel" ,
430
+ {"candidateMolecules" : input_file_1 },
431
+ )
432
+
433
+ # Assert
434
+ wait_for_workflow (da , r_wfid )
435
+ # Additional, detailed checks...
436
+ # Check we only have one RunningWorkflowStep, and it succeeded
437
+ response = da .get_running_workflow_steps (running_workflow_id = r_wfid )
438
+
439
+ assert response ["count" ] == 4
440
+ assert response ["running_workflow_steps" ][0 ]["done" ]
441
+ assert response ["running_workflow_steps" ][0 ]["success" ]
442
+ assert response ["running_workflow_steps" ][1 ]["done" ]
443
+ assert response ["running_workflow_steps" ][1 ]["success" ]
444
+ assert response ["running_workflow_steps" ][2 ]["done" ]
445
+ assert response ["running_workflow_steps" ][2 ]["success" ]
446
+ assert response ["running_workflow_steps" ][3 ]["done" ]
447
+ assert response ["running_workflow_steps" ][3 ]["success" ]
448
+ # This test should generate a file in the simulated project directory
449
+ assert project_file_exists (output_file_first )
450
+ assert project_file_exists (output_file_final )
0 commit comments