def test_adjacent_false(): """Test if returns false.""" from simple_graph import Graph graph = Graph() graph.add_node('chicken') graph.add_node('egg') assert graph.adjacent('egg', 'chicken') is False
def test_adjacent(key, value): from simple_graph import Graph new_graph = Graph() node1 = new_graph.add_node(key) node2 = new_graph.add_node(value) new_graph.add_edge(node1, node2) assert new_graph.adjacent(node1, node2) is True
def test_adjacent_true(): """Test if node returns true.""" from simple_graph import Graph graph = Graph() graph.add_node('chicken') graph.add_node('egg') graph.add_edge('egg', 'chicken') assert graph.adjacent('egg', 'chicken') is True