Further tests with non-sqlite unit tests

This commit is contained in:
Griatch 2023-12-10 23:56:50 +01:00
parent 3e70507730
commit b6d9282594
4 changed files with 24 additions and 20 deletions

View file

@ -1339,14 +1339,6 @@ class TestXYZGrid(BaseEvenniaTest):
zcoord = "map1"
def setUp(self):
from django.conf import settings
from evennia import create_object
# we need to create a home room for the grid to be able to be properly deleted
home = create_object(typeclass="typeclasses.rooms.Room", key="Home", nohome=True)
home.id = settings.DEFAULT_HOME.strip("#")
home.save()
self.grid, err = xyzgrid.XYZGrid.create("testgrid")
self.map_data1 = {"map": MAP1, "zcoord": self.zcoord}

View file

@ -3,13 +3,12 @@ Test tutorial_world/mob
"""
from mock import patch
from twisted.internet.base import DelayedCall
from twisted.trial.unittest import TestCase as TwistedTestCase
from evennia.commands.default.tests import BaseEvenniaCommandTest
from evennia.utils.create import create_object
from evennia.utils.test_resources import BaseEvenniaTest, mockdeferLater, mockdelay
from mock import patch
from twisted.internet.base import DelayedCall
from twisted.trial.unittest import TestCase as TwistedTestCase
from . import mob
from . import objects as tutobjects
@ -35,6 +34,10 @@ DelayedCall.debug = True
class TestTutorialWorldObjects(TwistedTestCase, BaseEvenniaCommandTest):
def tearDown(self):
self.char1.delete()
super(BaseEvenniaCommandTest, self).tearDown()
def test_tutorialobj(self):
obj1 = create_object(tutobjects.TutorialObject, key="tutobj")
obj1.reset()
@ -103,15 +106,19 @@ class TestTutorialWorldObjects(TwistedTestCase, BaseEvenniaCommandTest):
self.call(
tutobjects.CmdShiftRoot(),
"green root up",
"You shift the weedy green root upwards.|Holding aside the root you "
"think you notice something behind it ...",
(
"You shift the weedy green root upwards.|Holding aside the root you "
"think you notice something behind it ..."
),
obj=wall,
)
self.call(
tutobjects.CmdPressButton(),
"",
"You move your fingers over the suspicious depression, then gives it a "
"decisive push. First",
(
"You move your fingers over the suspicious depression, then gives it a "
"decisive push. First"
),
obj=wall,
)
# we patch out the delay, so these are closed immediately