mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Cleanup deprecated exception in websocket tests (#131808)
This commit is contained in:
parent
3a76bfb857
commit
f41bc98fe2
@ -15,13 +15,8 @@ from samsungtvws.exceptions import (
|
|||||||
)
|
)
|
||||||
from websockets import frames
|
from websockets import frames
|
||||||
|
|
||||||
# WebSocketProtocolError was deprecated in websockets '14.0'
|
|
||||||
# pylint: disable-next=no-name-in-module
|
# pylint: disable-next=no-name-in-module
|
||||||
from websockets.exceptions import (
|
from websockets.exceptions import ConnectionClosedError, WebSocketException
|
||||||
ConnectionClosedError,
|
|
||||||
WebSocketException,
|
|
||||||
WebSocketProtocolError,
|
|
||||||
)
|
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
from homeassistant.components import dhcp, ssdp, zeroconf
|
from homeassistant.components import dhcp, ssdp, zeroconf
|
||||||
@ -404,7 +399,7 @@ async def test_user_websocket_not_supported(hass: HomeAssistant) -> None:
|
|||||||
),
|
),
|
||||||
patch(
|
patch(
|
||||||
"homeassistant.components.samsungtv.bridge.SamsungTVWSAsyncRemote.open",
|
"homeassistant.components.samsungtv.bridge.SamsungTVWSAsyncRemote.open",
|
||||||
side_effect=WebSocketProtocolError("Boom"),
|
side_effect=WebSocketException("Boom"),
|
||||||
),
|
),
|
||||||
):
|
):
|
||||||
# websocket device not supported
|
# websocket device not supported
|
||||||
@ -787,12 +782,12 @@ async def test_ssdp_websocket_cannot_connect(hass: HomeAssistant) -> None:
|
|||||||
),
|
),
|
||||||
patch(
|
patch(
|
||||||
"homeassistant.components.samsungtv.bridge.SamsungTVEncryptedWSAsyncRemote.start_listening",
|
"homeassistant.components.samsungtv.bridge.SamsungTVEncryptedWSAsyncRemote.start_listening",
|
||||||
side_effect=WebSocketProtocolError("Boom"),
|
side_effect=WebSocketException("Boom"),
|
||||||
),
|
),
|
||||||
patch(
|
patch(
|
||||||
"homeassistant.components.samsungtv.bridge.SamsungTVWSAsyncRemote",
|
"homeassistant.components.samsungtv.bridge.SamsungTVWSAsyncRemote",
|
||||||
) as remotews,
|
) as remotews,
|
||||||
patch.object(remotews, "open", side_effect=WebSocketProtocolError("Boom")),
|
patch.object(remotews, "open", side_effect=WebSocketException("Boom")),
|
||||||
):
|
):
|
||||||
# device not supported
|
# device not supported
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
@ -1742,7 +1737,7 @@ async def test_update_legacy_missing_mac_from_dhcp_no_unique_id(
|
|||||||
),
|
),
|
||||||
patch(
|
patch(
|
||||||
"homeassistant.components.samsungtv.bridge.SamsungTVEncryptedWSAsyncRemote.start_listening",
|
"homeassistant.components.samsungtv.bridge.SamsungTVEncryptedWSAsyncRemote.start_listening",
|
||||||
side_effect=WebSocketProtocolError("Boom"),
|
side_effect=WebSocketException("Boom"),
|
||||||
),
|
),
|
||||||
):
|
):
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user