def test_delete_edge_key_error(): """Test if KeyError exception is raised.""" from simple_graph import Graph graph = Graph() graph.add_node('egg') with pytest.raises(KeyError): graph.delete_edge('dog', 'egg')
def test_delete_edge_in_graph(): """Test if an edge between two nodes is removed.""" from simple_graph import Graph graph = Graph() graph.add_node('chicken') graph.add_node('egg') graph.add_edge('egg', 'chicken') graph.delete_edge('egg', 'chicken') assert graph.container['egg'] == {}