From 9e6fc78ac2730f56376482bf7ad0d271012eaf60 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Thu, 18 Apr 2024 08:40:21 -0700 Subject: [PATCH] Make test deterministic --- tests/__snapshots__/test_pregel.ambr | 70 +++++++++++----------------- tests/test_pregel.py | 2 +- 2 files changed, 28 insertions(+), 44 deletions(-) diff --git a/tests/__snapshots__/test_pregel.ambr b/tests/__snapshots__/test_pregel.ambr index c9b710050..b6db4a4d0 100644 --- a/tests/__snapshots__/test_pregel.ambr +++ b/tests/__snapshots__/test_pregel.ambr @@ -95,16 +95,6 @@ "source": "left", "target": "condition" }, - { - "source": "condition", - "target": "left", - "data": "left" - }, - { - "source": "condition", - "target": "right", - "data": "right" - }, { "source": "condition", "target": "__end__", @@ -116,39 +106,33 @@ # --- # name: test_conditional_entrypoint_graph.3 ''' - +-----------+ - | __start__ | - +-----------+ - * - * - * - +--------------+ - | should_start | - +--------------+ - ** ** - ** ** - * ** - +------+ * - | left | * - +------+ * - * * - * * - * * - +-----------+ * - | condition | * - +-----------+*** * - * *** * - * **** * - * ** * - * +-------+ - ** | right | - ** +-------+ - ** ** - ** ** - * * - +---------+ - | __end__ | - +---------+ + +-----------+ + | __start__ | + +-----------+ + * + * + * + +--------------+ + | should_start | + +--------------+ + * ** + ** * + * ** + +------+ * + | left | * + +------+ * + * * + * * + * * + +-----------+ +-------+ + | condition | | right | + +-----------+ +-------+ + * * + ** ** + * * + +---------+ + | __end__ | + +---------+ ''' # --- # name: test_conditional_entrypoint_graph_state diff --git a/tests/test_pregel.py b/tests/test_pregel.py index f811a167d..d14103f9f 100644 --- a/tests/test_pregel.py +++ b/tests/test_pregel.py @@ -1367,7 +1367,7 @@ def test_conditional_entrypoint_graph(snapshot: SnapshotAssertion) -> None: should_start, {"go-left": "left", "go-right": "right"} ) - workflow.add_conditional_edges("left", lambda data: END) + workflow.add_conditional_edges("left", lambda data: END, {END: END}) workflow.add_edge("right", END) app = workflow.compile()