Testing¶
Helper methods for testing workflows.
- pyapp_flow.testing.call_node(node: Callable[[WorkflowContext], Any], *, workflow_context: WorkflowContext | None = None, **context_vars: Any) WorkflowContext¶
Simplifies the testing of any node.
Handles the boilerplate code required to set up a
pyapp_flow.WorkflowContextwith the expected variables.Method returns the generated context object to be asserted on.
def test_find_isbn__with_known_title(): context = call_node(find_isbn, title="Hyperion") actual = context.state["isbn_13"] assert actual == "978-0553283686"