Update tests for alias removal
This commit is contained in:
parent
64b6308bc6
commit
841714d6ca
2 changed files with 4 additions and 9 deletions
|
|
@ -287,7 +287,7 @@ async def test_direct_handler_passes_move(player, target, punch_right):
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_direct_handler_alias_for_variant(player, target, punch_right):
|
async def test_direct_handler_alias_for_variant(player, target, punch_right):
|
||||||
"""Test alias handler (e.g. pr) works for variant moves."""
|
"""Test direct handler works for variant moves."""
|
||||||
handler = combat_commands._make_direct_handler(
|
handler = combat_commands._make_direct_handler(
|
||||||
punch_right, combat_commands.do_attack
|
punch_right, combat_commands.do_attack
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,6 @@ async def test_commands_detail_simple_combat_move(player, combat_moves):
|
||||||
output = "".join([call[0][0] for call in player.writer.write.call_args_list])
|
output = "".join([call[0][0] for call in player.writer.write.call_args_list])
|
||||||
|
|
||||||
assert "roundhouse" in output
|
assert "roundhouse" in output
|
||||||
assert "aliases: rh" in output
|
|
||||||
assert "type: attack" in output
|
assert "type: attack" in output
|
||||||
assert "stamina: 8.0" in output
|
assert "stamina: 8.0" in output
|
||||||
assert "timing window: 2000ms" in output
|
assert "timing window: 2000ms" in output
|
||||||
|
|
@ -187,12 +186,10 @@ async def test_commands_detail_variant_base(player, combat_moves):
|
||||||
|
|
||||||
# Should show both variants
|
# Should show both variants
|
||||||
assert "punch left" in output
|
assert "punch left" in output
|
||||||
assert "aliases: pl" in output
|
|
||||||
assert "{attacker} winds up a left hook!" in output
|
assert "{attacker} winds up a left hook!" in output
|
||||||
assert "countered by: dodge right, parry high" in output
|
assert "countered by: dodge right, parry high" in output
|
||||||
|
|
||||||
assert "punch right" in output
|
assert "punch right" in output
|
||||||
assert "aliases: pr" in output
|
|
||||||
assert "{attacker} winds up a right hook!" in output
|
assert "{attacker} winds up a right hook!" in output
|
||||||
assert "countered by: dodge left, parry high" in output
|
assert "countered by: dodge left, parry high" in output
|
||||||
|
|
||||||
|
|
@ -209,7 +206,6 @@ async def test_commands_detail_specific_variant(player, combat_moves):
|
||||||
output = "".join([call[0][0] for call in player.writer.write.call_args_list])
|
output = "".join([call[0][0] for call in player.writer.write.call_args_list])
|
||||||
|
|
||||||
assert "punch left" in output
|
assert "punch left" in output
|
||||||
assert "aliases: pl" in output
|
|
||||||
assert "type: attack" in output
|
assert "type: attack" in output
|
||||||
assert "stamina: 5.0" in output
|
assert "stamina: 5.0" in output
|
||||||
assert "timing window: 1800ms" in output
|
assert "timing window: 1800ms" in output
|
||||||
|
|
@ -231,12 +227,11 @@ async def test_commands_detail_unknown_command(player):
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_commands_detail_via_alias(player, combat_moves):
|
async def test_commands_detail_via_prefix(player, combat_moves):
|
||||||
"""Test commands detail view via an alias."""
|
"""Test commands detail view via prefix matching."""
|
||||||
await commands.dispatch(player, "commands rh")
|
await commands.dispatch(player, "commands rh")
|
||||||
output = "".join([call[0][0] for call in player.writer.write.call_args_list])
|
output = "".join([call[0][0] for call in player.writer.write.call_args_list])
|
||||||
|
|
||||||
# Should show the full command details, not the alias
|
# Should show the full command details via prefix match
|
||||||
assert "roundhouse" in output
|
assert "roundhouse" in output
|
||||||
assert "aliases: rh" in output
|
|
||||||
assert "type: attack" in output
|
assert "type: attack" in output
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue