Isolate EvenniaTestCase/EvenniaCommandTest for pristine settings

This commit is contained in:
Griatch 2021-12-22 01:23:03 +01:00
parent 541e5a116a
commit 498a031662
40 changed files with 223 additions and 123 deletions

View file

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

View file

@ -3,4 +3,10 @@ Custom gametime contrib - Griatch, vlgeoff 2017
"""
from .custom_gametime import * # noqa
from .custom_gametime import time_to_tuple, UNITS # noqa
from .custom_gametime import gametime_to_realtime # noqa
from .custom_gametime import realtime_to_gametime # noqa
from .custom_gametime import custom_gametime # noqa
from .custom_gametime import real_seconds_until # noqa
from .custom_gametime import schedule # noqa
from .custom_gametime import GametimeScript # noqa

View file

@ -6,7 +6,7 @@ Testing custom game time
# Testing custom_gametime
from mock import Mock, patch
from evennia.utils.test_resources import EvenniaTest
from . import custom_gametime
from .. import custom_gametime
def _testcallback():

View file

@ -3,11 +3,11 @@ Test email login.
"""
from evennia.commands.default.tests import CommandTest
from evennia.commands.default.tests import EvenniaCommandTest
from . import email_login
class TestEmailLogin(CommandTest):
class TestEmailLogin(EvenniaCommandTest):
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 CommandTest
from evennia.commands.default.tests import EvenniaCommandTest
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(EvenniaTest):
self.assertEqual(self.room1.callbacks.all(), {})
class TestCmdCallback(CommandTest):
class TestCmdCallback(EvenniaCommandTest):
"""Test the @callback command."""
@ -425,7 +425,7 @@ class TestCmdCallback(CommandTest):
self.assertEqual(callback.valid, True)
class TestDefaultCallbacks(CommandTest):
class TestDefaultCallbacks(EvenniaCommandTest):
"""Test the default callbacks."""

View file

@ -4,4 +4,4 @@ Menu-login - Vinvent-lg 2016, Griatch 2019
"""
from .menu_login import UnloggedinCmdSet # noqa
from .menu_login import connection_screens # noqa
from . import connection_screens # noqa

View file

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

View file

@ -3,17 +3,17 @@ Legacy Mux comms tests (extracted from 0.9.5)
"""
from evennia.commands.default.tests import CommandTest
from evennia.commands.default.tests import EvenniaCommandTest
from . import mux_comms_cmds as comms
class TestLegacyMuxComms(CommandTest):
class TestLegacyMuxComms(EvenniaCommandTest):
"""
Test the legacy comms contrib.
"""
def setUp(self):
super(CommandTest, self).setUp()
super().setUp()
self.call(
comms.CmdChannelCreate(),
"testchan;test=Test Channel",

View file

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