MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / test_countdown

Method test_countdown

example_code/item_109.py:138–144  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

136class ReusableTimerUnitTest(TestCase):
137
138 def test_countdown(self):
139 my_func = lambda: None
140 with mock.patch("threading.Timer"):
141 timer = ReusableTimer()
142 timer.countdown(0.1, my_func)
143 threading.Timer.assert_called_once_with(0.1, my_func)
144 timer.timer.start.assert_called_once()
145
146 def test_end(self):
147 my_func = lambda: None

Callers

nothing calls this directly

Calls 2

countdownMethod · 0.95
ReusableTimerClass · 0.85

Tested by

no test coverage detected