Skip to content

Commit

Permalink
test: add test for new controls property in workflow decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-schmid committed Oct 16, 2024
1 parent 91627f7 commit e72b4eb
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/compiler/test_workflow_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1686,6 +1686,38 @@ def test_workflow_input_with_json_body_and_default():
#########################################################################################################


@workflow(
description="This is a description of my workflow", controls=["CC4.1", "CC2.3"]
)
def workflow_with_controls(payload: dict[str, JsonValue]):
dummy_test_action1()


def test_workflow_with_controls():
expected_dag = WorkflowDAG(
name="workflow_with_controls",
description="This is a description of my workflow",
start=WorkflowStart(triggers=[]),
controls=["CC4.1", "CC2.3"],
dag={
"start": ActionNode(
id="start", type="start", children=["dummy_test_action1"]
),
# dummy_test_action1()
"dummy_test_action1": ActionNode(
id="dummy_test_action1",
type="dummy_test_action1",
),
},
)
dag = WorkflowCompiler().compile(workflow_with_controls)
assert dag == expected_dag
assert WorkflowDAG.model_validate(dag.model_dump()) == expected_dag


#########################################################################################################


@workflow
def workflow_input_mixed(payload: dict[str, JsonValue]):
"""
Expand Down

0 comments on commit e72b4eb

Please sign in to comment.