def test_serialization_networkx_graph(): p1 = to_canonical_address("0x5522070585a1a275631ba69c444ac0451AA9Fe4C") p2 = to_canonical_address("0x5522070585a1a275631ba69c444ac0451AA9Fe4D") p3 = to_canonical_address("0x5522070585a1a275631ba69c444ac0451AA9Fe4E") p4 = to_canonical_address("0x5522070585a1a275631ba69c444ac0451AA9Fe4F") e = [(p1, p2), (p2, p3), (p3, p4)] graph = Graph(e) data = serialization.serialize_networkx_graph(graph) restored_graph = serialization.deserialize_networkx_graph(data) assert graph.edges == restored_graph.edges
def test_serialization_networkx_graph(): p1 = to_canonical_address('0x5522070585a1a275631ba69c444ac0451AA9Fe4C') p2 = to_canonical_address('0x5522070585a1a275631ba69c444ac0451AA9Fe4D') p3 = to_canonical_address('0x5522070585a1a275631ba69c444ac0451AA9Fe4E') p4 = to_canonical_address('0x5522070585a1a275631ba69c444ac0451AA9Fe4F') e = [(p1, p2), (p2, p3), (p3, p4)] graph = Graph(e) data = serialization.serialize_networkx_graph(graph) restored_graph = serialization.deserialize_networkx_graph(data) assert graph.edges == restored_graph.edges