Skip to content

Commit

Permalink
Refactor test to use custom serialization method instead of pickle
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielluiz committed Sep 23, 2024
1 parent df4a440 commit 5b41b5c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/backend/tests/unit/graph/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5b41b5c

Please sign in to comment.