chore: add more fixtures

This commit is contained in:
Abhishek Kumar 2026-05-08 16:28:09 +05:30
parent 5a358d4d29
commit 45a81c88e0
3 changed files with 33 additions and 6 deletions

View file

@ -222,23 +222,26 @@ class WorkflowGraph:
def _assert_start_node(self):
errors: list[WorkflowError] = []
start_node = [n for n in self.nodes.values() if n.data.is_start]
if not start_node:
start_nodes = [n for n in self.nodes.values() if n.data.is_start]
if not start_nodes:
errors.append(
WorkflowError(
kind=ItemKind.workflow,
id=None,
field=None,
message="Workflow must have exactly one start node",
message="Workflow has no start node — exactly one is required",
)
)
elif len(start_node) > 1:
elif len(start_nodes) > 1:
errors.append(
WorkflowError(
kind=ItemKind.workflow,
id=None,
field=None,
message="Workflow must have exactly one start node",
message=(
f"Workflow has {len(start_nodes)} start nodes — "
f"exactly one is required"
),
)
)
return errors