Add 'examine' as valid switch alias for 'show' with its corresponding tests
This commit is contained in:
parent
1cbbdf5410
commit
e956bcf3be
2 changed files with 11 additions and 10 deletions
|
|
@ -2856,7 +2856,7 @@ class CmdSpawn(COMMAND_DEFAULT_CLASS):
|
||||||
|
|
||||||
key = "@spawn"
|
key = "@spawn"
|
||||||
aliases = ["olc"]
|
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)"
|
locks = "cmd:perm(spawn) or perm(Builder)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -513,24 +513,25 @@ class TestBuilding(CommandTest):
|
||||||
"No prototype 'NO_EXISTS' was found.")
|
"No prototype 'NO_EXISTS' was found.")
|
||||||
|
|
||||||
# @spawn/examine (missing prototype)
|
# @spawn/examine (missing prototype)
|
||||||
self.call(
|
# lists all prototypes that exist
|
||||||
|
msg = self.call(
|
||||||
building.CmdSpawn(),
|
building.CmdSpawn(),
|
||||||
'/examine',
|
'/examine')
|
||||||
'@spawn: Extra switch "/examine" ignored.|Usage: @spawn <prototype-key> or {key: value, ...}\n (2 existing prototypes. Use /list to inspect)')
|
assert 'testball' in msg and 'testprot' in msg
|
||||||
|
|
||||||
# @spawn/examine with valid prototype
|
# @spawn/examine with valid prototype
|
||||||
self.call(
|
# prints the prototype
|
||||||
|
msg = self.call(
|
||||||
building.CmdSpawn(),
|
building.CmdSpawn(),
|
||||||
'/examine BALL',
|
'/examine BALL')
|
||||||
# FIXME: should this print the existing prototype
|
assert 'Ball' in msg and 'testball' in msg
|
||||||
# instead of spawning it?
|
|
||||||
'@spawn: Extra switch "/examine" ignored.|Spawned Ball(#13).')
|
|
||||||
|
|
||||||
# @spawn/examine with invalid prototype
|
# @spawn/examine with invalid prototype
|
||||||
|
# shows error
|
||||||
self.call(
|
self.call(
|
||||||
building.CmdSpawn(),
|
building.CmdSpawn(),
|
||||||
'/examine NO_EXISTS',
|
'/examine NO_EXISTS',
|
||||||
'@spawn: Extra switch "/examine" ignored.|No prototype named \'NO_EXISTS\'.')
|
"No prototype 'NO_EXISTS' was found.")
|
||||||
|
|
||||||
|
|
||||||
class TestComms(CommandTest):
|
class TestComms(CommandTest):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue