mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
feat: #4 add tests to increase code coverage
add test_store_key_raises_RunTimeError and test_remove_raises_RunTimeError to scripts/tests.py to increase code coverage for scripts/tickethandler.py
This commit is contained in:
parent
6e7cf07b75
commit
3a06c7dc91
1 changed files with 12 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ from evennia.scripts.models import ObjectDoesNotExist, ScriptDB
|
|||
from evennia.scripts.scripts import DoNothing, ExtendedLoopingCall
|
||||
from evennia.utils.create import create_script
|
||||
from evennia.utils.test_resources import BaseEvenniaTest
|
||||
from evennia.scripts.tickerhandler import TickerHandler
|
||||
|
||||
|
||||
class TestScript(BaseEvenniaTest):
|
||||
|
|
@ -18,6 +19,17 @@ class TestScript(BaseEvenniaTest):
|
|||
self.assertFalse(errors, errors)
|
||||
mockinit.assert_called()
|
||||
|
||||
class Test_improve_coverage(TestCase):
|
||||
def test_store_key_raises_RunTimeError(self):
|
||||
with self.assertRaises(RuntimeError):
|
||||
th=TickerHandler()
|
||||
th._store_key(None, None, 0, None)
|
||||
|
||||
def test_remove_raises_RunTimeError(self):
|
||||
with self.assertRaises(RuntimeError):
|
||||
th=TickerHandler()
|
||||
th.remove(callback=1)
|
||||
|
||||
|
||||
class TestScriptDB(TestCase):
|
||||
"Check the singleton/static ScriptDB object works correctly"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue