mirror of
https://github.com/evennia/evennia.git
synced 2026-03-31 04:57:16 +02:00
tests: #11 add test for invalid argument
Tests invalid argument to start method in ExtendedLoopingCall class throws ValueError
This commit is contained in:
parent
8da24eb014
commit
f31b954bd7
1 changed files with 7 additions and 0 deletions
|
|
@ -143,6 +143,13 @@ class TestExtendedLoopingCall(TestCase):
|
|||
self.assertEqual(loopcall.interval, 20)
|
||||
loopcall._scheduleFrom.assert_called_with(121)
|
||||
|
||||
def test_start_invalid_interval(self):
|
||||
""" Test the .start method with interval less than zero """
|
||||
with self.assertRaises(ValueError):
|
||||
callback = mock.MagicMock()
|
||||
loopcall = ExtendedLoopingCall(callback)
|
||||
loopcall.start(-1, now=True, start_delay=None, count_start=1)
|
||||
|
||||
def dummy_func():
|
||||
return 0
|
||||
class TestMonitorHandler(TestCase):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue