Skip to content

Commit e4b99b4

Browse files
author
Alan Christie
committed
fix: Tets now runs validator
1 parent 44ccfac commit e4b99b4

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

tests/test_workflow_engine_examples.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
from tests.message_queue import UnitTestMessageQueue
1717
from tests.wapi_adapter import UnitTestWorkflowAPIAdapter
1818
from workflow.workflow_engine import WorkflowEngine
19+
from workflow.workflow_validator import (
20+
ValidationLevel,
21+
ValidationResult,
22+
WorkflowValidator,
23+
)
1924

2025

2126
@pytest.fixture
@@ -55,8 +60,9 @@ def start_workflow(
5560

5661
# To start a workflow we need to:
5762
# 1. Load and create a Workflow Definition
58-
# 2. Create a Running Workflow record
59-
# 3. Send a Workflow START message
63+
# 2. Validate the workflow for running
64+
# 3. Create a Running Workflow record
65+
# 4. Send a Workflow START message
6066
#
6167
# 1.
6268
workflow_path = os.path.join(
@@ -68,6 +74,13 @@ def start_workflow(
6874
wf_response = da.create_workflow(workflow_definition=wf_definition)
6975
print(f"Created workflow definition {wf_response}")
7076
# 2.
77+
vr_result: ValidationResult = WorkflowValidator.validate(
78+
workflow_definition=wf_definition,
79+
workflow_inputs=variables,
80+
level=ValidationLevel.RUN,
81+
)
82+
assert vr_result.error_num == 0
83+
# 3.
7184
response = da.create_running_workflow(
7285
user_id="dlister",
7386
workflow_id=wf_response["id"],

0 commit comments

Comments
 (0)