srne-mqtt/tests/test_protocol.py

12 lines
223 B
Python
Raw Normal View History

2023-12-08 12:45:38 +00:00
from io import BytesIO
from srnemqtt.protocol import write as protocol_write
def test_write():
fh = BytesIO()
protocol_write(fh, b"Hello, World!")
fh.seek(0)
assert fh.read() == b"Hello, World!\x4E\x11"