(self)
| 122 | assert_equal(res, [{"builtins"}, {"d"}, {"c", "b"}, {"a"}]) |
| 123 | |
| 124 | def test_order_ascc(self) -> None: |
| 125 | manager = self._make_manager() |
| 126 | graph = { |
| 127 | "a": State.new_state("a", None, "import b, c", manager), |
| 128 | "d": State.new_state("d", None, "def f(): import a", manager), |
| 129 | "b": State.new_state("b", None, "import c", manager), |
| 130 | "c": State.new_state("c", None, "import b, d", manager), |
| 131 | "builtins": State.new_state("builtins", None, "", manager), |
| 132 | } |
| 133 | manager.parse_all(list(graph.values())) |
| 134 | res = [scc.mod_ids for scc in sorted_components(graph)] |
| 135 | assert_equal(res, [{"builtins"}, {"a", "d", "c", "b"}]) |
| 136 | ascc = res[1] |
| 137 | scc = order_ascc(graph, ascc) |
| 138 | assert_equal(scc, ["d", "c", "b", "a"]) |
nothing calls this directly
no test coverage detected