(self)
| 175 | graph.ensure_not_cyclic() |
| 176 | |
| 177 | def test_iterative_dfs(self): |
| 178 | graph = MigrationGraph() |
| 179 | root = ("app_a", "1") |
| 180 | graph.add_node(root, None) |
| 181 | expected = [root] |
| 182 | for i in range(2, 750): |
| 183 | parent = ("app_a", str(i - 1)) |
| 184 | child = ("app_a", str(i)) |
| 185 | graph.add_node(child, None) |
| 186 | graph.add_dependency(str(i), child, parent) |
| 187 | expected.append(child) |
| 188 | leaf = expected[-1] |
| 189 | |
| 190 | forwards_plan = graph.forwards_plan(leaf) |
| 191 | self.assertEqual(expected, forwards_plan) |
| 192 | |
| 193 | backwards_plan = graph.backwards_plan(root) |
| 194 | self.assertEqual(expected[::-1], backwards_plan) |
| 195 | |
| 196 | def test_iterative_dfs_complexity(self): |
| 197 | """ |
nothing calls this directly
no test coverage detected