Exemplo n.º 1
0
 def test_cut(self):
     # Assert unlink Node(b) and redirect a->c and a->d.
     g = graph.Graph()
     g.add_edge("a", "b")
     g.add_edge("b", "c")
     g.add_edge("b", "d")
     graph.cut(g, g["b"])
     self.assertTrue(len(g["b"].edges) == 0)
     self.assertTrue(g.edge("a", "c") is not None)
     self.assertTrue(g.edge("a", "d") is not None)
     print "pattern.graph.cut()"
Exemplo n.º 2
0
 def test_cut(self):
     # Assert unlink Node(b) and redirect a->c and a->d.
     g = graph.Graph()
     g.add_edge("a", "b")
     g.add_edge("b", "c")
     g.add_edge("b", "d")
     graph.cut(g, g["b"])
     self.assertTrue(len(g["b"].edges) == 0)
     self.assertTrue(g.edge("a","c") is not None)
     self.assertTrue(g.edge("a","d") is not None)
     print "pattern.graph.cut()"