mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Fixing the tests.
This commit is contained in:
parent
5278ecb730
commit
5b1139cf11
3 changed files with 42 additions and 5 deletions
|
|
@ -203,7 +203,7 @@ class ObjManipCommand(COMMAND_DEFAULT_CLASS):
|
|||
|
||||
try:
|
||||
type_class = (
|
||||
class_from_module(found_typeclass)
|
||||
class_from_module(found_typeclass, settings.TYPECLASS_PATHS)
|
||||
if isinstance(found_typeclass, str)
|
||||
else found_typeclass
|
||||
)
|
||||
|
|
|
|||
|
|
@ -725,16 +725,17 @@ class TestAccount(BaseEvenniaCommandTest):
|
|||
|
||||
class TestBuilding(BaseEvenniaCommandTest):
|
||||
def test_create(self):
|
||||
name = settings.BASE_OBJECT_TYPECLASS.rsplit(".", 1)[1]
|
||||
typeclass = settings.BASE_OBJECT_TYPECLASS
|
||||
name = typeclass.rsplit(".", 1)[1]
|
||||
self.call(
|
||||
building.CmdCreate(),
|
||||
"/d TestObj1", # /d switch is abbreviated form of /drop
|
||||
f"/d TestObj1:{typeclass}", # /d switch is abbreviated form of /drop
|
||||
"You create a new %s: TestObj1." % name,
|
||||
)
|
||||
self.call(building.CmdCreate(), "", "Usage: ")
|
||||
self.call(
|
||||
building.CmdCreate(),
|
||||
"TestObj1;foo;bar",
|
||||
f"TestObj1;foo;bar:{typeclass}",
|
||||
"You create a new %s: TestObj1 (aliases: foo, bar)." % name,
|
||||
)
|
||||
|
||||
|
|
@ -2082,7 +2083,7 @@ class TestBatchProcess(BaseEvenniaCommandTest):
|
|||
# cannot test batchcode here, it must run inside the server process
|
||||
self.call(
|
||||
batchprocess.CmdBatchCommands(),
|
||||
"batchprocessor.example_batch_cmds",
|
||||
"batchprocessor.example_batch_cmds_test",
|
||||
"Running Batch-command processor - Automatic mode for"
|
||||
" batchprocessor.example_batch_cmds",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
#
|
||||
# This is an example batch build file for Evennia.
|
||||
#
|
||||
# This version is stripped down to work better with the test system.
|
||||
# It avoids teleporting the button. For the full version look at the
|
||||
# other example_batch_cmds.ev file.
|
||||
|
||||
# This creates a red button
|
||||
|
||||
create/drop button:red_button.RedButton
|
||||
|
||||
# This comment ends input for @create
|
||||
# Next command:
|
||||
|
||||
set button/desc =
|
||||
This is a large red button. Now and then
|
||||
it flashes in an evil, yet strangely tantalizing way.
|
||||
|
||||
A big sign sits next to it. It says:
|
||||
|
||||
|
||||
-----------
|
||||
|
||||
Press me!
|
||||
|
||||
-----------
|
||||
|
||||
|
||||
... It really begs to be pressed, doesn't it? You
|
||||
know you want to!
|
||||
|
||||
# This ends the @set command. Note that line breaks and extra spaces
|
||||
# in the argument are not considered. A completely empty line
|
||||
# translates to a \n newline in the command; two empty lines will thus
|
||||
# create a new paragraph. (note that few commands support it though, you
|
||||
# mainly want to use it for descriptions).
|
||||
Loading…
Add table
Add a link
Reference in a new issue