| 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. |