| Total Complexity | 4 |
| Total Lines | 10 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import unittest |
||
| 19 | class BreadthFirstSearchUnitTest(unittest.TestCase): |
||
| 20 | def test_dfs(self): |
||
| 21 | g = create_graph() |
||
| 22 | s = 0 |
||
| 23 | dfs = BreadthFirstSearch(g, s) |
||
| 24 | |||
| 25 | for v in range(1, g.vertex_count()): |
||
| 26 | if dfs.hasPathTo(v): |
||
| 27 | print(str(s) + ' is connected to ' + str(v)) |
||
| 28 | print('path is ' + ' => '.join([str(i) for i in dfs.pathTo(v)])) |
||
| 29 | |||
| 33 |