From e956bcf3be4c9a6cae51b01c4f04e4e9f8dbe31b Mon Sep 17 00:00:00 2001 From: Henddher Pedroza Date: Sun, 21 Oct 2018 14:15:34 -0500 Subject: [PATCH] Add 'examine' as valid switch alias for 'show' with its corresponding tests --- evennia/commands/default/building.py | 2 +- evennia/commands/default/tests.py | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/evennia/commands/default/building.py b/evennia/commands/default/building.py index 65fedaf5c2..503a9c15e9 100644 --- a/evennia/commands/default/building.py +++ b/evennia/commands/default/building.py @@ -2856,7 +2856,7 @@ class CmdSpawn(COMMAND_DEFAULT_CLASS): key = "@spawn" aliases = ["olc"] - switch_options = ("noloc", "search", "list", "show", "save", "delete", "menu", "olc", "update", "edit") + switch_options = ("noloc", "search", "list", "show", "examine", "save", "delete", "menu", "olc", "update", "edit") locks = "cmd:perm(spawn) or perm(Builder)" help_category = "Building" diff --git a/evennia/commands/default/tests.py b/evennia/commands/default/tests.py index f285cc9614..7b2c78951b 100644 --- a/evennia/commands/default/tests.py +++ b/evennia/commands/default/tests.py @@ -513,24 +513,25 @@ class TestBuilding(CommandTest): "No prototype 'NO_EXISTS' was found.") # @spawn/examine (missing prototype) - self.call( + # lists all prototypes that exist + msg = self.call( building.CmdSpawn(), - '/examine', - '@spawn: Extra switch "/examine" ignored.|Usage: @spawn or {key: value, ...}\n (2 existing prototypes. Use /list to inspect)') + '/examine') + assert 'testball' in msg and 'testprot' in msg # @spawn/examine with valid prototype - self.call( + # prints the prototype + msg = self.call( building.CmdSpawn(), - '/examine BALL', - # FIXME: should this print the existing prototype - # instead of spawning it? - '@spawn: Extra switch "/examine" ignored.|Spawned Ball(#13).') + '/examine BALL') + assert 'Ball' in msg and 'testball' in msg # @spawn/examine with invalid prototype + # shows error self.call( building.CmdSpawn(), '/examine NO_EXISTS', - '@spawn: Extra switch "/examine" ignored.|No prototype named \'NO_EXISTS\'.') + "No prototype 'NO_EXISTS' was found.") class TestComms(CommandTest):