11
11
from informaticsmatters .protobuf .datamanager .workflow_message_pb2 import WorkflowMessage
12
12
13
13
from tests .config import TEST_PROJECT_ID
14
- from tests .instance_launcher import UnitTestInstanceLauncher , project_file_exists
14
+ from tests .instance_launcher import (
15
+ EXECUTION_DIRECTORY ,
16
+ UnitTestInstanceLauncher ,
17
+ project_file_exists ,
18
+ )
15
19
from tests .message_dispatcher import UnitTestMessageDispatcher
16
20
from tests .message_queue import UnitTestMessageQueue
17
21
from tests .wapi_adapter import UnitTestWorkflowAPIAdapter
@@ -200,7 +204,6 @@ def test_workflow_engine_example_smiles_to_file(basic_engine):
200
204
assert project_file_exists (output_file )
201
205
202
206
203
- @pytest .mark .skip (reason = "The engine does not currently create the required variables" )
204
207
def test_workflow_engine_shortcut_example_1 (basic_engine ):
205
208
# Arrange
206
209
da , md = basic_engine
@@ -229,20 +232,71 @@ def test_workflow_engine_shortcut_example_1(basic_engine):
229
232
assert project_file_exists (output_file_b )
230
233
231
234
232
- @pytest .mark .skip (reason = "The engine does not currently create the required variables" )
235
+ # @pytest.mark.skip(reason="The engine does not currently create the required variables")
233
236
def test_workflow_engine_simple_python_molprops (basic_engine ):
234
237
# Arrange
235
238
da , md = basic_engine
236
239
# Make sure files that should be generated by the test
237
240
# do not exist before we run the test.
238
- output_file_a = "a.sdf"
239
- assert not project_file_exists (output_file_a )
240
- output_file_b = "b.sdf"
241
- assert not project_file_exists (output_file_b )
241
+ output_file_1 = "step1.out.smi"
242
+ assert not project_file_exists (output_file_1 )
243
+ output_file_2 = "step2.out.smi"
244
+ assert not project_file_exists (output_file_2 )
245
+ # And create the test's input file.
246
+ input_file_1 = "input1.smi"
247
+ input_file_1_content = """O=C(CSCc1ccc(Cl)s1)N1CCC(O)CC1
248
+ RDKit 3D
249
+
250
+ 18 19 0 0 0 0 0 0 0 0999 V2000
251
+ 8.7102 -1.3539 24.2760 O 0 0 0 0 0 0 0 0 0 0 0 0
252
+ 9.4334 -2.1203 23.6716 C 0 0 0 0 0 0 0 0 0 0 0 0
253
+ 10.3260 -1.7920 22.4941 C 0 0 0 0 0 0 0 0 0 0 0 0
254
+ 9.5607 -0.5667 21.3699 S 0 0 0 0 0 0 0 0 0 0 0 0
255
+ 7.9641 -1.3976 21.0216 C 0 0 0 0 0 0 0 0 0 0 0 0
256
+ 7.1007 -0.5241 20.1671 C 0 0 0 0 0 0 0 0 0 0 0 0
257
+ 5.7930 -0.1276 20.3932 C 0 0 0 0 0 0 0 0 0 0 0 0
258
+ 5.2841 0.6934 19.3422 C 0 0 0 0 0 0 0 0 0 0 0 0
259
+ 6.2234 0.8796 18.3624 C 0 0 0 0 0 0 0 0 0 0 0 0
260
+ 6.0491 1.8209 16.9402 Cl 0 0 0 0 0 0 0 0 0 0 0 0
261
+ 7.6812 0.0795 18.6678 S 0 0 0 0 0 0 0 0 0 0 0 0
262
+ 9.5928 -3.4405 24.2306 N 0 0 0 0 0 0 0 0 0 0 0 0
263
+ 10.8197 -3.4856 25.0609 C 0 0 0 0 0 0 0 0 0 0 0 0
264
+ 11.0016 -4.9279 25.4571 C 0 0 0 0 0 0 0 0 0 0 0 0
265
+ 9.9315 -5.2800 26.4615 C 0 0 0 0 0 0 0 0 0 0 0 0
266
+ 10.3887 -4.7677 27.7090 O 0 0 0 0 0 0 0 0 0 0 0 0
267
+ 8.5793 -4.6419 26.1747 C 0 0 0 0 0 0 0 0 0 0 0 0
268
+ 8.3826 -4.0949 24.7695 C 0 0 0 0 0 0 0 0 0 0 0 0
269
+ 1 2 2 0
270
+ 2 3 1 0
271
+ 2 12 1 0
272
+ 3 4 1 0
273
+ 4 5 1 0
274
+ 5 6 1 0
275
+ 6 7 2 0
276
+ 7 8 1 0
277
+ 8 9 2 0
278
+ 9 10 1 0
279
+ 9 11 1 0
280
+ 11 6 1 0
281
+ 12 13 1 0
282
+ 13 14 1 0
283
+ 14 15 1 0
284
+ 15 16 1 0
285
+ 15 17 1 0
286
+ 17 18 1 0
287
+ 18 12 1 0
288
+ M END
289
+
290
+ $$$$
291
+ """
292
+ with open (
293
+ f"{ EXECUTION_DIRECTORY } /{ input_file_1 } " , mode = "wt" , encoding = "utf8"
294
+ ) as input_file :
295
+ input_file .writelines (input_file_1_content )
242
296
243
297
# Act
244
298
r_wfid = start_workflow (
245
- md , da , "simple-python-molprops" , {"candidateMolecules" : "C" }
299
+ md , da , "simple-python-molprops" , {"candidateMolecules" : input_file_1 }
246
300
)
247
301
248
302
# Assert
@@ -256,5 +310,5 @@ def test_workflow_engine_simple_python_molprops(basic_engine):
256
310
assert response ["running_workflow_steps" ][1 ]["done" ]
257
311
assert response ["running_workflow_steps" ][1 ]["success" ]
258
312
# This test should generate a file in the simulated project directory
259
- assert project_file_exists (output_file_a )
260
- assert project_file_exists (output_file_b )
313
+ assert project_file_exists (output_file_1 )
314
+ assert project_file_exists (output_file_2 )
0 commit comments