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))
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)
def test_multigraph(self): with pytest.raises(nx.NetworkXException): e = nx.katz_centrality(nx.MultiGraph(), 0.1)
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))
def test_multigraph_numpy(self): with pytest.raises(nx.NetworkXException): e = nx.eigenvector_centrality_numpy(nx.MultiGraph())