def test_graph_nodes_list(): graph = Graph() a = graph.add_node("a") b = graph.add_node("b") actual = graph.get_nodes() expected = [a, b] assert actual == expected
def test_get_nodes(): g = Graph() g.add_node('a') g.add_node('b') expected = ['a', 'b'] actual = [] [actual.append(item.value) for item in g.get_nodes()] assert actual == expected
def test_get_nodes(): graph = Graph() graph.add_node("banana") graph.add_node("apple") expected = 2 actual = len(graph.get_nodes()) assert actual == expected
def test_graph_nodes_empty(): graph = Graph() actual = graph.get_nodes() expected = None assert actual == expected
def test_get_all_nodes(): graph = Graph() node = graph.add_node('node') node_two = graph.add_node('node_two') assert len(graph.get_nodes()) == 2