Tests: #11 test force_repeat
Test forcing script to run that is scheduled to run in the future
This commit is contained in:
parent
d044e31f08
commit
2e4bced351
1 changed files with 11 additions and 0 deletions
|
|
@ -163,6 +163,17 @@ class TestExtendedLoopingCall(TestCase):
|
||||||
self.assertEqual(loopcall.start_delay, None)
|
self.assertEqual(loopcall.start_delay, None)
|
||||||
self.assertEqual(loopcall.starttime, 1)
|
self.assertEqual(loopcall.starttime, 1)
|
||||||
|
|
||||||
|
def test_force_repeat(self):
|
||||||
|
""" Test forcing script to run that is scheduled to run in the future """
|
||||||
|
callback = mock.MagicMock()
|
||||||
|
loopcall = ExtendedLoopingCall(callback)
|
||||||
|
loopcall.clock.seconds = mock.MagicMock(return_value=0)
|
||||||
|
|
||||||
|
loopcall.start(20, now=False, start_delay=5, count_start=0)
|
||||||
|
loopcall.force_repeat()
|
||||||
|
|
||||||
|
callback.assert_called_once()
|
||||||
|
|
||||||
def dummy_func():
|
def dummy_func():
|
||||||
return 0
|
return 0
|
||||||
class TestMonitorHandler(TestCase):
|
class TestMonitorHandler(TestCase):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue