(ts)
| 7 | class TestTopologicalSort(unittest.TestCase): |
| 8 | def _test_graph(self, graph, expected): |
| 9 | def static_order_with_groups(ts): |
| 10 | ts.prepare() |
| 11 | while ts.is_active(): |
| 12 | nodes = ts.get_ready() |
| 13 | for node in nodes: |
| 14 | ts.done(node) |
| 15 | yield tuple(sorted(nodes)) |
| 16 | |
| 17 | ts = graphlib.TopologicalSorter(graph) |
| 18 | self.assertEqual(list(static_order_with_groups(ts)), list(expected)) |