Ignore logging events in zha websocket tests (#113031)

This commit is contained in:
J. Nick Koston 2024-03-10 13:13:26 -10:00 committed by GitHub
parent fad5fc5256
commit 7ea79148ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -704,7 +704,13 @@ async def test_ws_permit_with_qr_code(
{ID: 14, TYPE: f"{DOMAIN}/devices/{SERVICE_PERMIT}", **params}
)
msg = await zha_client.receive_json()
msg_type = None
while msg_type != const.TYPE_RESULT:
# There will be logging events coming over the websocket
# as well so we want to ignore those
msg = await zha_client.receive_json()
msg_type = msg["type"]
assert msg["id"] == 14
assert msg["type"] == const.TYPE_RESULT
assert msg["success"]
@ -761,7 +767,13 @@ async def test_ws_permit_ha12(
{ID: 14, TYPE: f"{DOMAIN}/devices/{SERVICE_PERMIT}", **params}
)
msg = await zha_client.receive_json()
msg_type = None
while msg_type != const.TYPE_RESULT:
# There will be logging events coming over the websocket
# as well so we want to ignore those
msg = await zha_client.receive_json()
msg_type = msg["type"]
assert msg["id"] == 14
assert msg["type"] == const.TYPE_RESULT
assert msg["success"]