Fix intermittently failing decryption error test (#1082)

This commit is contained in:
Steven B. 2024-07-24 18:58:37 +01:00 committed by GitHub
parent 055bbcc0c9
commit 1c83675e57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,6 @@
import json import json
import logging import logging
import re
import secrets import secrets
import time import time
from contextlib import nullcontext as does_not_raise from contextlib import nullcontext as does_not_raise
@ -298,7 +299,7 @@ async def test_transport_decrypt_error(mocker, caplog):
with pytest.raises( with pytest.raises(
KasaException, KasaException,
match="Error trying to decrypt device 127.0.0.1 response: Invalid padding bytes.", match=re.escape("Error trying to decrypt device 127.0.0.1 response:"),
): ):
await transport.send(json.dumps({})) await transport.send(json.dumps({}))