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

Method test_unlink

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

Source from the content-addressed store, hash-verified

605 pass
606
607 def test_unlink(self):
608 # Assert remove all edges to/from Node(a).
609 g = graph.Graph()
610 g.add_edge("a", "b")
611 g.add_edge("a", "c")
612 graph.unlink(g, g["a"])
613 self.assertTrue(len(g.edges) == 0)
614 # Assert remove edges between Node(a) and Node(b)
615 g = graph.Graph()
616 g.add_edge("a", "b")
617 g.add_edge("a", "c")
618 graph.unlink(g, g["a"], "b")
619 self.assertTrue(len(g.edges) == 1)
620 print "pattern.graph.unlink()"
621
622 def test_redirect(self):
623 # Assert transfer connections of Node(a) to Node(d).

Callers

nothing calls this directly

Calls 2

add_edgeMethod · 0.95
lenFunction · 0.85

Tested by

no test coverage detected