MCPcopy Index your code
hub / github.com/clips/pattern / test_redirect

Method test_redirect

test/test_graph.py:622–632  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

620 print "pattern.graph.unlink()"
621
622 def test_redirect(self):
623 # Assert transfer connections of Node(a) to Node(d).
624 g = graph.Graph()
625 g.add_edge("a", "b")
626 g.add_edge("c", "a")
627 g.add_node("d")
628 graph.redirect(g, g["a"], "d")
629 self.assertTrue(len(g["a"].edges) == 0)
630 self.assertTrue(len(g["d"].edges) == 2)
631 self.assertTrue(g.edge("d","c").node1 == g["c"])
632 print "pattern.graph.redirect()"
633
634 def test_cut(self):
635 # Assert unlink Node(b) and redirect a->c and a->d.

Callers

nothing calls this directly

Calls 5

add_edgeMethod · 0.95
add_nodeMethod · 0.95
edgeMethod · 0.95
lenFunction · 0.85
redirectMethod · 0.80

Tested by

no test coverage detected