MCPcopy Create free account
hub / github.com/python/mypy / test_order_ascc

Method test_order_ascc

mypy/test/testgraph.py:124–138  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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"])

Callers

nothing calls this directly

Calls 8

_make_managerMethod · 0.95
sorted_componentsFunction · 0.90
assert_equalFunction · 0.90
order_asccFunction · 0.90
listClass · 0.85
new_stateMethod · 0.80
parse_allMethod · 0.80
valuesMethod · 0.80

Tested by

no test coverage detected