mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-12-21 04:00:19 +00:00
Rename and deprecate exception classes (#739)
# Public # SmartDeviceException -> KasaException UnsupportedDeviceException(SmartDeviceException) -> UnsupportedDeviceError(KasaException) TimeoutException(SmartDeviceException, asyncio.TimeoutError) -> TimeoutError(KasaException, asyncio.TimeoutError) Add new exception for error codes -> DeviceError(KasaException) AuthenticationException(SmartDeviceException) -> AuthenticationError(DeviceError) # Internal # RetryableException(SmartDeviceException) -> _RetryableError(DeviceError) ConnectionException(SmartDeviceException) -> _ConnectionError(KasaException)
This commit is contained in:
@@ -8,7 +8,7 @@ from kasa.credentials import Credentials
|
||||
from kasa.deviceconfig import (
|
||||
DeviceConfig,
|
||||
)
|
||||
from kasa.exceptions import SmartDeviceException
|
||||
from kasa.exceptions import KasaException
|
||||
|
||||
|
||||
async def test_serialization():
|
||||
@@ -29,7 +29,7 @@ async def test_serialization():
|
||||
ids=["invalid-dict", "not-dict"],
|
||||
)
|
||||
def test_deserialization_errors(input_value, expected_msg):
|
||||
with pytest.raises(SmartDeviceException, match=expected_msg):
|
||||
with pytest.raises(KasaException, match=expected_msg):
|
||||
DeviceConfig.from_dict(input_value)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user