Update tests for clean command listings
This commit is contained in:
parent
7ae56106d6
commit
6e9a89f21e
1 changed files with 13 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue