mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
docs: #21 add missing docstrings
Add missing docstrings for scripts/tests.py
This commit is contained in:
parent
99d4f36bf6
commit
5de52855d1
1 changed files with 12 additions and 0 deletions
|
|
@ -1,3 +1,8 @@
|
|||
"""
|
||||
Unit tests for the scripts module
|
||||
|
||||
"""
|
||||
|
||||
from unittest import TestCase, mock
|
||||
from collections import defaultdict
|
||||
|
||||
|
|
@ -25,18 +30,25 @@ class TestScript(BaseEvenniaTest):
|
|||
mockinit.assert_called()
|
||||
|
||||
class TestTickerHandler(TestCase):
|
||||
""" Test the TickerHandler class """
|
||||
|
||||
def test_store_key_raises_RunTimeError(self):
|
||||
""" Test _store_key method raises RuntimeError for interval < 1 """
|
||||
with self.assertRaises(RuntimeError):
|
||||
th=TickerHandler()
|
||||
th._store_key(None, None, 0, None)
|
||||
|
||||
def test_remove_raises_RunTimeError(self):
|
||||
""" Test remove method raises RuntimeError for catching old ordering of arguments """
|
||||
with self.assertRaises(RuntimeError):
|
||||
th=TickerHandler()
|
||||
th.remove(callback=1)
|
||||
|
||||
class TestScriptDBManager(TestCase):
|
||||
""" Test the ScriptDBManger class """
|
||||
|
||||
def test_not_obj_return_empty_list(self):
|
||||
""" Test get_all_scripts_on_obj returns empty list for falsy object """
|
||||
manager_obj = ScriptDBManager()
|
||||
returned_list = manager_obj.get_all_scripts_on_obj(False)
|
||||
self.assertEqual(returned_list, [])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue