Skip to content

Commit

Permalink
Fix unit tests for 3.12 (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
puddly authored Aug 2, 2023
1 parent 4a9a3c0 commit 53603d9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/test_uart.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ async def mock_conn(loop, protocol_factory, **kwargs):


def test_send(gw):
data = b"\x00"
data = b"test"
gw.send(data)
assert gw._transport.write.call_count == 1
assert gw._transport.write.called_once_with(data)

packet = b""
packet += b"\xC0" # END
packet += b"test" # data
packet += b"\x40\xFE" # checksum
packet += b"\xC0" # END

gw._transport.write.assert_called_once_with(packet)


def test_close(gw):
Expand Down

0 comments on commit 53603d9

Please sign in to comment.