Skip to content

Commit

Permalink
Add 'examine' as valid switch alias for 'show' with its corresponding…
Browse files Browse the repository at this point in the history
… tests
  • Loading branch information
Henddher committed Oct 21, 2018
1 parent 9d800aa commit 79a64ce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion evennia/commands/default/building.py
Expand Up @@ -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"

Expand Down
19 changes: 10 additions & 9 deletions evennia/commands/default/tests.py
Expand Up @@ -513,24 +513,25 @@ def getObject(commandTest, objKeyStr):
"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 <prototype-key> 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):
Expand Down

0 comments on commit 79a64ce

Please sign in to comment.