Merge pull request #3453 from chiizujin/disambiguation

Fix aliases not being shown for disambiguation
This commit is contained in:
Griatch 2024-03-30 15:31:10 +01:00 committed by GitHub
commit a5a4d98093
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 6 deletions

View file

@ -6,6 +6,7 @@ import time
from anything import Anything
from evennia import DefaultObject, create_object, default_cmds
from evennia.commands.default import building
from evennia.commands.default.tests import BaseEvenniaCommandTest
from evennia.utils.test_resources import BaseEvenniaTest
@ -413,10 +414,9 @@ class TestRPSystemCommands(BaseEvenniaCommandTest):
expected_first_call = [
"More than one match for 'Mushroom' (please narrow target):",
f" Mushroom-1 []",
f" Mushroom-2 []",
f" Mushroom-1",
f" Mushroom-2",
]
self.call(default_cmds.CmdLook(), "Mushroom", "\n".join(expected_first_call)) # PASSES
expected_second_call = f"Mushroom(#{mushroom1.id})\nThe first mushroom is brown."
@ -424,3 +424,13 @@ class TestRPSystemCommands(BaseEvenniaCommandTest):
expected_third_call = f"Mushroom(#{mushroom2.id})\nThe second mushroom is red."
self.call(default_cmds.CmdLook(), "Mushroom-2", expected_third_call) # FAILS
expected_fourth_call = "Alias(es) for 'Mushroom' set to 'fungus'."
self.call(building.CmdSetObjAlias(), "Mushroom-1 = fungus", expected_fourth_call) #PASSES
expected_fifth_call = [
"More than one match for 'Mushroom' (please narrow target):",
f" Mushroom-1 [fungus]",
f" Mushroom-2",
]
self.call(default_cmds.CmdLook(), "Mushroom", "\n".join(expected_fifth_call)) # PASSES