diff --git a/python/tests/test_graphdb/test_graphdb_imports.py b/python/tests/test_graphdb/test_graphdb_imports.py index 836771562..0dd6fda55 100644 --- a/python/tests/test_graphdb/test_graphdb_imports.py +++ b/python/tests/test_graphdb/test_graphdb_imports.py @@ -56,3 +56,31 @@ def test_import_with_int(): g2.import_node(g.node(1)) g2.import_nodes([g.node(2), g.node(3)]) assert g2.count_nodes() == g.count_nodes() + + +def test_import_edges(): + g = Graph() + g.add_node(1, 1) + g.add_node(1, 2) + g.add_node(1, 3) + g.add_edge(1, 4, 5) + g.add_edge(1, 6, 7) + g.add_edge(1, 8, 9) + g2 = Graph() + g2.import_edges(g.edges) + assert g2.count_edges() == 3 + assert g.edges.id == g2.edges.id + + +def test_import_edges_iterator(): + g = Graph() + g.add_node(1, 1) + g.add_node(1, 2) + g.add_node(1, 3) + g.add_edge(1, 4, 5) + g.add_edge(1, 6, 7) + g.add_edge(1, 8, 9) + g2 = Graph() + g2.import_edges(iter(g.edges)) + assert g2.count_edges() == 3 + assert g.edges.id == g2.edges.id