Skip to content

Commit

Permalink
Fix failing EZSP protocol tests
Browse files Browse the repository at this point in the history
  • Loading branch information
puddly committed Apr 12, 2024
1 parent 2024a66 commit a1ab0da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/test_ezsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ async def test_form_network_fail_stack_status(ezsp_f):
def test_receive_new(ezsp_f):
callback = MagicMock()
ezsp_f.add_callback(callback)
ezsp_f.frame_received(b"\x00\xff\x00\x04\x05\x06")
ezsp_f.frame_received(b"\x00\xff\x00\x04\x05\x06\x00")
assert callback.call_count == 1


Expand Down
4 changes: 2 additions & 2 deletions tests/test_ezsp_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def test_command(prot_hndl):
def test_receive_reply(prot_hndl):
callback_mock = MagicMock(spec_set=asyncio.Future)
prot_hndl._awaiting[0] = (0, prot_hndl.COMMANDS["version"][2], callback_mock)
prot_hndl(b"\x00\xff\x00\x04\x05\x06")
prot_hndl(b"\x00\xff\x00\x04\x05\x06\x00")

assert 0 not in prot_hndl._awaiting
assert callback_mock.set_exception.call_count == 0
Expand All @@ -42,7 +42,7 @@ def test_receive_reply_after_timeout(prot_hndl):
callback_mock = MagicMock(spec_set=asyncio.Future)
callback_mock.set_result.side_effect = asyncio.InvalidStateError()
prot_hndl._awaiting[0] = (0, prot_hndl.COMMANDS["version"][2], callback_mock)
prot_hndl(b"\x00\xff\x00\x04\x05\x06")
prot_hndl(b"\x00\xff\x00\x04\x05\x06\x00")

assert 0 not in prot_hndl._awaiting
assert callback_mock.set_exception.call_count == 0
Expand Down

0 comments on commit a1ab0da

Please sign in to comment.