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

Method test_is_active

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

Source from the content-addressed store, hash-verified

190 self.assertFalse(ts.is_active())
191
192 def test_is_active(self):
193 ts = graphlib.TopologicalSorter()
194 ts.add(1, 2)
195 ts.prepare()
196
197 self.assertTrue(ts.is_active())
198 self.assertEqual(ts.get_ready(), (2,))
199 self.assertTrue(ts.is_active())
200 ts.done(2)
201 self.assertTrue(ts.is_active())
202 self.assertEqual(ts.get_ready(), (1,))
203 self.assertTrue(ts.is_active())
204 ts.done(1)
205 self.assertFalse(ts.is_active())
206
207 def test_not_hashable_nodes(self):
208 ts = graphlib.TopologicalSorter()

Callers

nothing calls this directly

Calls 8

addMethod · 0.95
prepareMethod · 0.95
is_activeMethod · 0.95
get_readyMethod · 0.95
doneMethod · 0.95
assertTrueMethod · 0.80
assertFalseMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected