Exemple #1
0
 def test_edges_with_data_equal(self):
     G = nx.MultiGraph()
     nx.add_path(G, [0, 1, 2], weight=1)
     H = nx.MultiGraph()
     nx.add_path(H, [0, 1, 2], weight=1)
     self._test_equal(G.edges(data=True, keys=True),
                      H.edges(data=True, keys=True))
Exemple #2
0
 def test_multigraphs_equal(self):
     G = nx.path_graph(4, create_using=nx.MultiGraph())
     H = nx.MultiGraph()
     nx.add_path(H, range(4))
     self._test_equal(G, H)
Exemple #3
0
 def test_multigraph(self):
     with pytest.raises(nx.NetworkXException):
         e = nx.katz_centrality(nx.MultiGraph(), 0.1)
Exemple #4
0
 def test_no_edges(self):
     G = nx.MultiGraph()
     H = nx.MultiGraph()
     self._test_equal(G.edges(data=True, keys=True),
                      H.edges(data=True, keys=True))
Exemple #5
0
 def test_multigraph_numpy(self):
     with pytest.raises(nx.NetworkXException):
         e = nx.eigenvector_centrality_numpy(nx.MultiGraph())