MCPcopy
hub / github.com/networkx/networkx / test_none_node

Method test_none_node

networkx/classes/tests/test_graph.py:46–55  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

44 assert sorted(G.nodes(data=True)) == [(0, {}), (1, {}), (2, {})]
45
46 def test_none_node(self):
47 G = self.Graph()
48 with pytest.raises(ValueError):
49 G.add_node(None)
50 with pytest.raises(ValueError):
51 G.add_nodes_from([None])
52 with pytest.raises(ValueError):
53 G.add_edge(0, None)
54 with pytest.raises(ValueError):
55 G.add_edges_from([(0, None)])
56
57 def test_has_node(self):
58 G = self.K3

Callers

nothing calls this directly

Calls 4

add_nodeMethod · 0.95
add_nodes_fromMethod · 0.95
add_edgeMethod · 0.95
add_edges_fromMethod · 0.95

Tested by

no test coverage detected