Update test_char_vitals_sent_on_rest_complete to expect both Status and Vitals
This commit is contained in:
parent
6ed71873b5
commit
ca282851e3
1 changed files with 15 additions and 9 deletions
|
|
@ -284,15 +284,21 @@ async def test_char_vitals_sent_on_rest_complete(player):
|
||||||
|
|
||||||
await process_resting()
|
await process_resting()
|
||||||
|
|
||||||
# Should have called send_gmcp with Char.Vitals
|
# Should have called send_gmcp with both Char.Status and Char.Vitals
|
||||||
player.writer.send_gmcp.assert_called_once_with(
|
assert player.writer.send_gmcp.call_count == 2
|
||||||
"Char.Vitals",
|
|
||||||
{
|
# First call should be Char.Status
|
||||||
"pl": round(player.pl, 1),
|
first_call = player.writer.send_gmcp.call_args_list[0]
|
||||||
"stamina": round(player.max_stamina, 1),
|
assert first_call[0][0] == "Char.Status"
|
||||||
"max_stamina": round(player.max_stamina, 1),
|
|
||||||
},
|
# Second call should be Char.Vitals
|
||||||
)
|
second_call = player.writer.send_gmcp.call_args_list[1]
|
||||||
|
assert second_call[0][0] == "Char.Vitals"
|
||||||
|
assert second_call[0][1] == {
|
||||||
|
"pl": round(player.pl, 1),
|
||||||
|
"stamina": round(player.max_stamina, 1),
|
||||||
|
"max_stamina": round(player.max_stamina, 1),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue