Skip to content
Permalink
Browse files

test inverse

  • Loading branch information
rusty1s committed Jan 6, 2020
1 parent c0458f0 commit fe4616b74dae5a6def0a6ff2c44c96671a03eb2c
Showing with 15 additions and 0 deletions.
  1. +15 −0 test/utils/test_convert.py
@@ -95,6 +95,21 @@ def test_from_networkx_non_consecutive():
assert data.edge_index.tolist() == [[0, 1], [1, 0]]


def test_from_networkx_inverse():
graph = nx.Graph()
graph.add_node(3)
graph.add_node(2)
graph.add_node(1)
graph.add_node(0)
graph.add_edge(3, 1)
graph.add_edge(2, 1)
graph.add_edge(1, 0)

data = from_networkx(graph)
assert len(data) == 1
assert data.edge_index.tolist() == [[0, 1, 2, 2, 2, 3], [2, 2, 0, 1, 3, 2]]


def test_from_networkx_non_numeric_labels():
graph = nx.Graph()
graph.add_node('4')

0 comments on commit fe4616b

Please sign in to comment.
You can’t perform that action at this time.