Avoid reset for all connection errors

This commit is contained in:
sdb9696
2024-01-23 17:51:18 +00:00
parent 0e874a35f1
commit f68acb60e7
6 changed files with 6 additions and 30 deletions

View File

@@ -7,7 +7,6 @@ import pytest
from ..deviceconfig import DeviceConfig
from ..exceptions import (
ConnectionException,
DisconnectedException,
SmartDeviceException,
TimeoutException,
)
@@ -19,13 +18,13 @@ from ..httpclient import HttpClient
[
(
aiohttp.ServerDisconnectedError(),
DisconnectedException,
"Disconnected from the device: ",
ConnectionException,
"Device connection error: ",
),
(
aiohttp.ClientOSError(),
ConnectionException,
"Unable to connect to the device: ",
"Device connection error: ",
),
(
aiohttp.ServerTimeoutError(),

View File

@@ -57,7 +57,7 @@ class _mock_response:
(aiohttp.ServerDisconnectedError("dummy exception"), True),
(aiohttp.ClientOSError("dummy exception"), True),
],
ids=("Exception", "SmartDeviceException", "DisconnectError", "ConnectError"),
ids=("Exception", "ServerTimeoutError", "ServerDisconnectedError", "ClientOSError"),
)
@pytest.mark.parametrize("transport_class", [AesTransport, KlapTransport])
@pytest.mark.parametrize("protocol_class", [IotProtocol, SmartProtocol])