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

Method test_paths

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

Source from the content-addressed store, hash-verified

424 print "pattern.graph.breadth_first_search()"
425
426 def test_paths(self):
427 # Assert depth-first all paths.
428 g = self.g.copy()
429 g.add_edge("a","d")
430 for id1, id2, length, path in (
431 ("a", "a", 1, [["a"]]),
432 ("a", "d", 3, [["a","d"], ["a","b","d"]]),
433 ("a", "d", 2, [["a","d"]]),
434 ("a", "d", 1, []),
435 ("a", "x", 1, [])):
436 p = graph.paths(g, id1, id2, length)
437 self.assertEqual(p, path)
438 print "pattern.graph.paths()"
439
440 def test_edges(self):
441 # Assert path of nodes to edges.

Callers

nothing calls this directly

Calls 3

pathsMethod · 0.80
copyMethod · 0.45
add_edgeMethod · 0.45

Tested by

no test coverage detected