MCPcopy Index your code
hub / github.com/python/cpython / test_simple_cases

Method test_simple_cases

Lib/test/test_graphlib.py:41–79  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

39 raise
40
41 def test_simple_cases(self):
42 self._test_graph(
43 {2: {11}, 9: {11, 8}, 10: {11, 3}, 11: {7, 5}, 8: {7, 3}},
44 [(3, 5, 7), (8, 11), (2, 9, 10)],
45 )
46
47 self._test_graph({1: {}}, [(1,)])
48
49 self._test_graph(
50 {x: {x + 1} for x in range(10)}, [(x,) for x in range(10, -1, -1)]
51 )
52
53 self._test_graph(
54 {2: {3}, 3: {4}, 4: {5}, 5: {1}, 11: {12}, 12: {13}, 13: {14}, 14: {15}},
55 [(1, 15), (5, 14), (4, 13), (3, 12), (2, 11)],
56 )
57
58 self._test_graph(
59 {
60 0: [1, 2],
61 1: [3],
62 2: [5, 6],
63 3: [4],
64 4: [9],
65 5: [3],
66 6: [7],
67 7: [8],
68 8: [4],
69 9: [],
70 },
71 [(9,), (4,), (3, 8), (1, 5, 7), (6,), (2,), (0,)],
72 )
73
74 self._test_graph({0: [1, 2], 1: [], 2: [3], 3: []}, [(1, 3), (2,), (0,)])
75
76 self._test_graph(
77 {0: [1, 2], 1: [], 2: [3], 3: [], 4: [5], 5: [6], 6: []},
78 [(1, 3, 6), (2, 5), (0, 4)],
79 )
80
81 def test_no_dependencies(self):
82 self._test_graph({1: {2}, 3: {4}, 5: {6}}, [(2, 4, 6), (1, 3, 5)])

Callers

nothing calls this directly

Calls 1

_test_graphMethod · 0.95

Tested by

no test coverage detected