MCPcopy
hub / github.com/networkx/networkx / test_add_edge

Method test_add_edge

networkx/classes/tests/test_multigraph.py:299–308  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

297 G.remove_node(-1)
298
299 def test_add_edge(self):
300 G = self.Graph()
301 G.add_edge(0, 1)
302 assert G.adj == {0: {1: {0: {}}}, 1: {0: {0: {}}}}
303 G = self.Graph()
304 G.add_edge(*(0, 1))
305 assert G.adj == {0: {1: {0: {}}}, 1: {0: {0: {}}}}
306 G = self.Graph()
307 with pytest.raises(ValueError):
308 G.add_edge(None, "anything")
309
310 def test_add_edge_conflicting_key(self):
311 G = self.Graph()

Callers

nothing calls this directly

Calls 1

add_edgeMethod · 0.95

Tested by

no test coverage detected