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

Method test_topsort

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

Source from the content-addressed store, hash-verified

23 assert_equal(list(topsort(data)), [])
24
25 def test_topsort(self) -> None:
26 a = frozenset({"A"})
27 b = frozenset({"B"})
28 c = frozenset({"C"})
29 d = frozenset({"D"})
30 data: dict[AbstractSet[str], set[AbstractSet[str]]] = {a: {b, c}, b: {d}, c: {d}}
31 res = list(topsort(data))
32 assert_equal(res, [{d}, {b, c}, {a}])
33
34 def test_topsort_orphan(self) -> None:
35 a = frozenset({"A"})

Callers

nothing calls this directly

Calls 4

topsortClass · 0.90
assert_equalFunction · 0.90
frozensetClass · 0.85
listClass · 0.85

Tested by

no test coverage detected