11"""Test for pyotgw/messageprocessor.py"""
2+
23import asyncio
34import logging
45import re
@@ -103,7 +104,7 @@ async def test_process_msgs(caplog, pygw_message_processor):
103104 "B" ,
104105 v .READ_ACK ,
105106 b"\x23 " ,
106- b"\x0A " ,
107+ b"\x0a " ,
107108 b"\x01 " ,
108109 )
109110 with patch .object (
@@ -155,6 +156,7 @@ async def empty_coroutine(status):
155156
156157 for test_case , expected_result in pygw_proto_messages :
157158 pygw_message_processor .status_manager .reset ()
159+ pygw_message_processor .status_manager ._updateq .get_nowait ()
158160 await pygw_message_processor ._process_msg (test_case )
159161 if expected_result is not None :
160162 await called_once (status_callback )
@@ -304,24 +306,16 @@ async def empty_coroutine(stat):
304306 return
305307
306308 with patch .object (
307- pygw_message_processor .status_manager ,
308- "submit_partial_update"
309+ pygw_message_processor .status_manager , "submit_partial_update"
309310 ) as partial_update :
310311 await pygw_message_processor ._quirk_trset_s2m (
311312 v .THERMOSTAT ,
312313 b"\x01 " ,
313314 b"\x02 " ,
314315 )
315- await pygw_message_processor ._quirk_trset_s2m (
316- v .BOILER ,
317- b"\x14 " ,
318- b"\x80 "
319- )
316+ await pygw_message_processor ._quirk_trset_s2m (v .BOILER , b"\x14 " , b"\x80 " )
320317
321- partial_update .assert_called_once_with (
322- v .BOILER ,
323- {v .DATA_ROOM_SETPOINT : 20.5 }
324- )
318+ partial_update .assert_called_once_with (v .BOILER , {v .DATA_ROOM_SETPOINT : 20.5 })
325319
326320
327321def test_get_flag8 (pygw_message_processor ):
@@ -373,7 +367,7 @@ def test_get_u8(pygw_message_processor):
373367 0 ,
374368 ),
375369 (
376- b"\xFF " ,
370+ b"\xff " ,
377371 255 ,
378372 ),
379373 )
@@ -390,7 +384,7 @@ def test_get_s8(pygw_message_processor):
390384 0 ,
391385 ),
392386 (
393- b"\xFF " ,
387+ b"\xff " ,
394388 - 1 ,
395389 ),
396390 )
@@ -411,7 +405,7 @@ def test_get_f8_8(pygw_message_processor):
411405 ),
412406 (
413407 (
414- b"\xFF " ,
408+ b"\xff " ,
415409 b"\x80 " ,
416410 ),
417411 - 0.5 ,
@@ -434,8 +428,8 @@ def test_get_u16(pygw_message_processor):
434428 ),
435429 (
436430 (
437- b"\xFF " ,
438- b"\xFF " ,
431+ b"\xff " ,
432+ b"\xff " ,
439433 ),
440434 65535 ,
441435 ),
@@ -457,8 +451,8 @@ def test_get_s16(pygw_message_processor):
457451 ),
458452 (
459453 (
460- b"\xFF " ,
461- b"\xFF " ,
454+ b"\xff " ,
455+ b"\xff " ,
462456 ),
463457 - 1 ,
464458 ),
0 commit comments