Skip to content

Commit 37c7154

Browse files
author
Alan Christie
committed
fix: Better engine test
1 parent f5b8c80 commit 37c7154

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

tests/test_workflow_engine_examples.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,7 @@ def basic_engine():
3333
print("Starting message queue...")
3434
message_queue.start()
3535

36-
yield [
37-
api_adapter,
38-
message_queue,
39-
message_dispatcher,
40-
workflow_engine,
41-
]
36+
yield [api_adapter, message_dispatcher]
4237

4338
print("Stopping message queue...")
4439
message_queue.stop()
@@ -89,7 +84,7 @@ def start_workflow(md, da, workflow_file_name, variables) -> str:
8984
return r_wfid
9085

9186

92-
def wait_for_workflow(da, mq, r_wfid, expect_success=True):
87+
def wait_for_workflow(da, r_wfid, expect_success=True):
9388
"""A convenience function to wait for and check a workflow execution
9489
(by inspecting the anticipated DB/API records). The workflow is expected
9590
to start (because start_workflow() has been called), this function
@@ -121,13 +116,13 @@ def wait_for_workflow(da, mq, r_wfid, expect_success=True):
121116

122117
def test_workflow_engine_example_two_step_nop(basic_engine):
123118
# Arrange
124-
da, mq, md, _ = basic_engine
119+
da, md = basic_engine
125120

126121
# Act
127122
r_wfid = start_workflow(md, da, "example-two-step-nop", {})
128123

129124
# Assert
130-
wait_for_workflow(da, mq, r_wfid)
125+
wait_for_workflow(da, r_wfid)
131126
# Additional, detailed checks...
132127
# Check there are the right number of RunningWorkflowStep Records
133128
# (and they're all set to success/done)
@@ -140,13 +135,13 @@ def test_workflow_engine_example_two_step_nop(basic_engine):
140135

141136
def test_workflow_engine_example_nop_fail(basic_engine):
142137
# Arrange
143-
da, mq, md, _ = basic_engine
138+
da, md = basic_engine
144139

145140
# Act
146141
r_wfid = start_workflow(md, da, "example-nop-fail", {})
147142

148143
# Assert
149-
wait_for_workflow(da, mq, r_wfid, expect_success=False)
144+
wait_for_workflow(da, r_wfid, expect_success=False)
150145
# Additional, detailed checks...
151146
# Check we only haver one step, and it failed
152147
response = da.get_running_workflow_steps(running_workflow_id=r_wfid)

0 commit comments

Comments
 (0)