diff --git a/evennia/commands/default/building.py b/evennia/commands/default/building.py index cd799bae7d..fd18fb28ae 100644 --- a/evennia/commands/default/building.py +++ b/evennia/commands/default/building.py @@ -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 ) diff --git a/evennia/commands/default/tests.py b/evennia/commands/default/tests.py index 340c5271a6..353bfe6ea7 100644 --- a/evennia/commands/default/tests.py +++ b/evennia/commands/default/tests.py @@ -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", ) diff --git a/evennia/contrib/tutorials/batchprocessor/example_batch_cmds_test.ev b/evennia/contrib/tutorials/batchprocessor/example_batch_cmds_test.ev new file mode 100644 index 0000000000..5f3bbe346d --- /dev/null +++ b/evennia/contrib/tutorials/batchprocessor/example_batch_cmds_test.ev @@ -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).