Refactor all test classes into evennia.utils.test_resources. Update docs.

This commit is contained in:
Griatch 2022-01-21 00:17:24 +01:00
parent 7912351e01
commit bbf45af2dd
28 changed files with 528 additions and 588 deletions

View file

@ -3,7 +3,7 @@ Building menu tests.
"""
from evennia.commands.default.tests import EvenniaCommandTest
from evennia.commands.default.tests import BaseEvenniaCommandTest
from . building_menu import BuildingMenu, CmdNoMatch
@ -12,7 +12,7 @@ class Submenu(BuildingMenu):
self.add_choice("title", key="t", attr="key")
class TestBuildingMenu(EvenniaCommandTest):
class TestBuildingMenu(BaseEvenniaCommandTest):
def setUp(self):
super(TestBuildingMenu, self).setUp()
self.menu = BuildingMenu(caller=self.char1, obj=self.room1, title="test")

View file

@ -3,11 +3,11 @@ Test email login.
"""
from evennia.commands.default.tests import EvenniaCommandTest
from evennia.commands.default.tests import BaseEvenniaCommandTest
from . import email_login
class TestEmailLogin(EvenniaCommandTest):
class TestEmailLogin(BaseEvenniaCommandTest):
def test_connect(self):
self.call(
email_login.CmdUnconnectedConnect(),

View file

@ -7,7 +7,7 @@ from textwrap import dedent
from django.conf import settings
from evennia import ScriptDB
from evennia.commands.default.tests import EvenniaCommandTest
from evennia.commands.default.tests import BaseEvenniaCommandTest
from evennia.objects.objects import ExitCommand
from evennia.utils import ansi, utils
from evennia.utils.create import create_object, create_script
@ -246,7 +246,7 @@ class TestEventHandler(BaseEvenniaTest):
self.assertEqual(self.room1.callbacks.all(), {})
class TestCmdCallback(EvenniaCommandTest):
class TestCmdCallback(BaseEvenniaCommandTest):
"""Test the @callback command."""
@ -425,7 +425,7 @@ class TestCmdCallback(EvenniaCommandTest):
self.assertEqual(callback.valid, True)
class TestDefaultCallbacks(EvenniaCommandTest):
class TestDefaultCallbacks(BaseEvenniaCommandTest):
"""Test the default callbacks."""

View file

@ -3,10 +3,10 @@ Test menu_login
"""
from evennia.commands.default.tests import EvenniaCommandTest
from evennia.commands.default.tests import BaseEvenniaCommandTest
from . import menu_login
class TestMenuLogin(EvenniaCommandTest):
class TestMenuLogin(BaseEvenniaCommandTest):
def test_cmdunloggedlook(self):
self.call(menu_login.CmdUnloggedinLook(), "", "======")

View file

@ -3,11 +3,11 @@ Legacy Mux comms tests (extracted from 0.9.5)
"""
from evennia.commands.default.tests import EvenniaCommandTest
from evennia.commands.default.tests import BaseEvenniaCommandTest
from . import mux_comms_cmds as comms
class TestLegacyMuxComms(EvenniaCommandTest):
class TestLegacyMuxComms(BaseEvenniaCommandTest):
"""
Test the legacy comms contrib.
"""

View file

@ -3,7 +3,7 @@ Test of the Unixcommand.
"""
from evennia.commands.default.tests import EvenniaCommandTest
from evennia.commands.default.tests import BaseEvenniaCommandTest
from .unixcommand import UnixCommand
@ -30,7 +30,7 @@ class CmdDummy(UnixCommand):
self.msg("{} * {} = {}".format(nb1, nb2, result))
class TestUnixCommand(EvenniaCommandTest):
class TestUnixCommand(BaseEvenniaCommandTest):
def test_success(self):
"""See the command parsing succeed."""
self.call(CmdDummy(), "5 10", "5 * 10 = 50")