First version of moved contrib tests
This commit is contained in:
parent
a6cb94056c
commit
04a95297b5
37 changed files with 4135 additions and 3589 deletions
27
evennia/contrib/grid/slow_exit/tests.py
Normal file
27
evennia/contrib/grid/slow_exit/tests.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
"""
|
||||
Slow exit tests.
|
||||
|
||||
"""
|
||||
|
||||
from mock import Mock, patch
|
||||
from evennia.commands.default.tests import CommandTest
|
||||
from evennia.utils.create import create_object
|
||||
from . import slow_exit
|
||||
|
||||
slow_exit.MOVE_DELAY = {"stroll": 0, "walk": 0, "run": 0, "sprint": 0}
|
||||
|
||||
|
||||
def _cancellable_mockdelay(time, callback, *args, **kwargs):
|
||||
callback(*args, **kwargs)
|
||||
return Mock()
|
||||
|
||||
|
||||
class TestSlowExit(CommandTest):
|
||||
@patch("evennia.utils.delay", _cancellable_mockdelay)
|
||||
def test_exit(self):
|
||||
exi = create_object(
|
||||
slow_exit.SlowExit, key="slowexit", location=self.room1, destination=self.room2
|
||||
)
|
||||
exi.at_traverse(self.char1, self.room2)
|
||||
self.call(slow_exit.CmdSetSpeed(), "walk", "You are now walking.")
|
||||
self.call(slow_exit.CmdStop(), "", "You stop moving.")
|
||||
Loading…
Add table
Add a link
Reference in a new issue