From c091958d9692f209c2da328a6a0e97df58fef915 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 23 Sep 2024 13:34:27 -0300 Subject: [PATCH] Refactor test to use custom serialization method instead of pickle --- src/backend/tests/unit/graph/test_graph.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/backend/tests/unit/graph/test_graph.py b/src/backend/tests/unit/graph/test_graph.py index a8a5c129050..70831491a0d 100644 --- a/src/backend/tests/unit/graph/test_graph.py +++ b/src/backend/tests/unit/graph/test_graph.py @@ -263,13 +263,12 @@ def test_update_source_handle(): assert updated_edge["data"]["sourceHandle"]["id"] == "last_node" -@pytest.mark.asyncio -async def test_pickle_graph(): +def test_serialize_graph(): starter_projects = load_starter_projects() data = starter_projects[0][1]["data"] graph = Graph.from_payload(data) assert isinstance(graph, Graph) - pickled = pickle.dumps(graph) - assert pickled is not None - unpickled = pickle.loads(pickled) - assert unpickled is not None + serialized = graph.dumps() + assert serialized is not None + assert isinstance(serialized, str) + assert len(serialized) > 0