def test_add_edge(): g = Graph() g.add_node(1) g.add_edge(3, 2) assert len(g.nodes()) == 3 assert ({3, 2}, 1) in g.edges()
def test_add_vertex(): g = Graph() g.add_node(1) g.add_node(2) assert 1 in g.nodes() assert 2 in g.nodes()