Update tests for clean command listings

This commit is contained in:
Jared Miller 2026-02-08 13:41:36 -05:00
parent 7ae56106d6
commit 6e9a89f21e
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C

View file

@ -96,16 +96,22 @@ async def test_commands_lists_all_commands(player):
@pytest.mark.asyncio
async def test_commands_shows_aliases(player):
"""Test that aliases are shown in parens after command names."""
async def test_commands_clean_names_no_parens(player):
"""Test that command names are shown cleanly without alias parens."""
await commands.dispatch(player, "commands")
output = "".join([call[0][0] for call in player.writer.write.call_args_list])
# Check that some aliases are shown in parentheses
assert "north(n)" in output or "north (n)" in output
assert "look(l)" in output or "look (l)" in output
assert "quit(q)" in output or "quit (q)" in output
assert "commands(cmds)" in output or "commands (cmds)" in output
# Commands should appear without parens
assert "north" in output
assert "look" in output
assert "quit" in output
assert "commands" in output
# Should NOT show aliases in parens
assert "north(n)" not in output
assert "look(l)" not in output
assert "quit(q)" not in output
assert "commands(cmds)" not in output
@pytest.mark.asyncio