First version of moved contrib tests

This commit is contained in:
Griatch 2021-12-18 23:42:14 +01:00
parent a6cb94056c
commit 04a95297b5
37 changed files with 4135 additions and 3589 deletions

View 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.")