Exemplo n.º 1
0
 def test_remove_edge_duplicate_correct(self):
     graph = Graph([(1, 2, 1), (1, 2, 1), (1, 2, 2), (2, 3, 1), (3, 1, 1)])
     graph.remove_edge(1, 2, 1)
     expected = [
         Edge(*args)
         for args in [(1, 2, 1), (1, 2, 2), (2, 3, 1), (3, 1, 1)]
     ]
     self.assertEqual(expected, graph.all_edges)
Exemplo n.º 2
0
 def test_remove_edge_correct(self):
     graph = Graph(self.edges)
     graph.remove_edge(1, 4, 4)
     expected = [
         Edge(*args)
         for args in [(1, 2, 4), (2, 4, 1), (2, 3, 4), (3, 4, 4)]
     ]
     self.assertEqual(expected, graph.all_edges)