def test_redirect(self): # Assert transfer connections of Node(a) to Node(d). g = graph.Graph() g.add_edge("a", "b") g.add_edge("c", "a") g.add_node("d") graph.redirect(g, g["a"], "d") self.assertTrue(len(g["a"].edges) == 0) self.assertTrue(len(g["d"].edges) == 2) self.assertTrue(g.edge("d", "c").node1 == g["c"]) print "pattern.graph.redirect()"
def test_redirect(self): # Assert transfer connections of Node(a) to Node(d). g = graph.Graph() g.add_edge("a", "b") g.add_edge("c", "a") g.add_node("d") graph.redirect(g, g["a"], "d") self.assertTrue(len(g["a"].edges) == 0) self.assertTrue(len(g["d"].edges) == 2) self.assertTrue(g.edge("d","c").node1 == g["c"]) print "pattern.graph.redirect()"