Merge pull request #2988 from InspectorCaracal/chargen-test-fix
Fix character creator tests
This commit is contained in:
commit
15fcb37194
1 changed files with 16 additions and 11 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
from unittest.mock import patch
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.test import override_settings
|
from django.test import override_settings
|
||||||
from evennia import DefaultCharacter
|
from evennia import DefaultCharacter
|
||||||
|
|
@ -8,25 +9,29 @@ from evennia.utils.test_resources import BaseEvenniaCommandTest
|
||||||
from . import character_creator
|
from . import character_creator
|
||||||
|
|
||||||
|
|
||||||
class TestAccount(BaseEvenniaCommandTest):
|
class TestCharacterCreator(BaseEvenniaCommandTest):
|
||||||
|
def setUp(self):
|
||||||
|
super().setUp()
|
||||||
|
self.account.swap_typeclass(character_creator.ContribChargenAccount)
|
||||||
|
|
||||||
def test_ooc_look(self):
|
def test_ooc_look(self):
|
||||||
if settings.MULTISESSION_MODE < 2:
|
|
||||||
self.call(
|
|
||||||
account.CmdOOCLook(), "", "You are out-of-character (OOC).", caller=self.account
|
|
||||||
)
|
|
||||||
if settings.MULTISESSION_MODE == 2:
|
|
||||||
# test both normal output and also inclusion of in-progress character
|
|
||||||
self.account.db._playable_characters = [self.char1]
|
self.account.db._playable_characters = [self.char1]
|
||||||
|
self.account.unpuppet_all()
|
||||||
|
|
||||||
self.char1.db.chargen_step = "start"
|
self.char1.db.chargen_step = "start"
|
||||||
|
|
||||||
|
with patch("evennia.commands.default.account._AUTO_PUPPET_ON_LOGIN", new=False):
|
||||||
|
# check that correct output is returning
|
||||||
output = self.call(
|
output = self.call(
|
||||||
account.CmdOOCLook(),
|
account.CmdOOCLook(),
|
||||||
"",
|
"",
|
||||||
"Account TestAccount (you are Out-of-Character)",
|
"Account TestAccount (you are Out-of-Character)",
|
||||||
caller=self.account,
|
caller=self.account,
|
||||||
)
|
)
|
||||||
self.assertIn("|Yin progress|n", output)
|
# check that char1 is recognized as in progress
|
||||||
|
self.assertIn("in progress", output)
|
||||||
|
|
||||||
@override_settings(CHARGEN_MENU="evennia.contrib.base_systems.character_creator.example_menu")
|
@override_settings(CHARGEN_MENU="evennia.contrib.rpg.character_creator.example_menu")
|
||||||
def test_char_create(self):
|
def test_char_create(self):
|
||||||
self.call(
|
self.call(
|
||||||
character_creator.ContribCmdCharCreate(),
|
character_creator.ContribCmdCharCreate(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue