mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
Update REST api mocking in SamsungTV (#68172)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
5eee600fa8
commit
de130d3b28
@ -731,11 +731,9 @@ async def test_ssdp_encrypted_websocket_not_supported(
|
|||||||
assert result["reason"] == RESULT_NOT_SUPPORTED
|
assert result["reason"] == RESULT_NOT_SUPPORTED
|
||||||
|
|
||||||
|
|
||||||
async def test_ssdp_websocket_cannot_connect(
|
@pytest.mark.usefixtures("rest_api_failing")
|
||||||
hass: HomeAssistant, rest_api: Mock
|
async def test_ssdp_websocket_cannot_connect(hass: HomeAssistant) -> None:
|
||||||
) -> None:
|
|
||||||
"""Test starting a flow from discovery and we cannot connect."""
|
"""Test starting a flow from discovery and we cannot connect."""
|
||||||
rest_api.rest_device_info.return_value = None
|
|
||||||
with patch(
|
with patch(
|
||||||
"homeassistant.components.samsungtv.bridge.Remote",
|
"homeassistant.components.samsungtv.bridge.Remote",
|
||||||
side_effect=OSError("Boom"),
|
side_effect=OSError("Boom"),
|
||||||
@ -901,10 +899,9 @@ async def test_import_legacy(hass: HomeAssistant) -> None:
|
|||||||
assert entries[0].data[CONF_PORT] == LEGACY_PORT
|
assert entries[0].data[CONF_PORT] == LEGACY_PORT
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("remote", "remotews")
|
@pytest.mark.usefixtures("remote", "remotews", "rest_api_failing")
|
||||||
async def test_import_legacy_without_name(hass: HomeAssistant, rest_api: Mock) -> None:
|
async def test_import_legacy_without_name(hass: HomeAssistant) -> None:
|
||||||
"""Test importing from yaml without a name."""
|
"""Test importing from yaml without a name."""
|
||||||
rest_api.rest_device_info.return_value = None
|
|
||||||
with patch(
|
with patch(
|
||||||
"homeassistant.components.samsungtv.bridge.SamsungTVEncryptedWSAsyncRemote.start_listening",
|
"homeassistant.components.samsungtv.bridge.SamsungTVEncryptedWSAsyncRemote.start_listening",
|
||||||
side_effect=WebSocketProtocolError("Boom"),
|
side_effect=WebSocketProtocolError("Boom"),
|
||||||
@ -1110,10 +1107,9 @@ async def test_zeroconf_ignores_soundbar(hass: HomeAssistant, rest_api: Mock) ->
|
|||||||
assert result["reason"] == "not_supported"
|
assert result["reason"] == "not_supported"
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("remote", "remotews", "remoteencws")
|
@pytest.mark.usefixtures("remote", "remotews", "remoteencws", "rest_api_failing")
|
||||||
async def test_zeroconf_no_device_info(hass: HomeAssistant, rest_api: Mock) -> None:
|
async def test_zeroconf_no_device_info(hass: HomeAssistant) -> None:
|
||||||
"""Test starting a flow from zeroconf where device_info returns None."""
|
"""Test starting a flow from zeroconf where device_info returns None."""
|
||||||
rest_api.rest_device_info.return_value = None
|
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
context={"source": config_entries.SOURCE_ZEROCONF},
|
context={"source": config_entries.SOURCE_ZEROCONF},
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
"""Tests for the Samsung TV Integration."""
|
"""Tests for the Samsung TV Integration."""
|
||||||
from copy import deepcopy
|
|
||||||
from unittest.mock import Mock, patch
|
from unittest.mock import Mock, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
@ -32,6 +31,7 @@ from .const import (
|
|||||||
MOCK_ENTRYDATA_WS,
|
MOCK_ENTRYDATA_WS,
|
||||||
MOCK_SSDP_DATA_MAIN_TV_AGENT_ST,
|
MOCK_SSDP_DATA_MAIN_TV_AGENT_ST,
|
||||||
MOCK_SSDP_DATA_RENDERING_CONTROL_ST,
|
MOCK_SSDP_DATA_RENDERING_CONTROL_ST,
|
||||||
|
SAMPLE_DEVICE_INFO_UE48JU6400,
|
||||||
)
|
)
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
@ -68,12 +68,7 @@ REMOTE_CALL = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="autouse_rest_api", autouse=True)
|
@pytest.mark.usefixtures("remotews", "remoteencws_failing", "rest_api")
|
||||||
def autouse_rest_api(rest_api) -> Mock:
|
|
||||||
"""Enable auto use of the rest api fixture for these tests."""
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("remotews", "remoteencws_failing")
|
|
||||||
async def test_setup(hass: HomeAssistant) -> None:
|
async def test_setup(hass: HomeAssistant) -> None:
|
||||||
"""Test Samsung TV integration is setup."""
|
"""Test Samsung TV integration is setup."""
|
||||||
await async_setup_component(hass, SAMSUNGTV_DOMAIN, MOCK_CONFIG)
|
await async_setup_component(hass, SAMSUNGTV_DOMAIN, MOCK_CONFIG)
|
||||||
@ -115,7 +110,7 @@ async def test_setup_from_yaml_without_port_device_offline(hass: HomeAssistant)
|
|||||||
assert config_entries_domain[0].state == ConfigEntryState.SETUP_RETRY
|
assert config_entries_domain[0].state == ConfigEntryState.SETUP_RETRY
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("remotews", "remoteencws_failing")
|
@pytest.mark.usefixtures("remotews", "remoteencws_failing", "rest_api")
|
||||||
async def test_setup_from_yaml_without_port_device_online(hass: HomeAssistant) -> None:
|
async def test_setup_from_yaml_without_port_device_online(hass: HomeAssistant) -> None:
|
||||||
"""Test import from yaml when the device is online."""
|
"""Test import from yaml when the device is online."""
|
||||||
await async_setup_component(hass, SAMSUNGTV_DOMAIN, MOCK_CONFIG)
|
await async_setup_component(hass, SAMSUNGTV_DOMAIN, MOCK_CONFIG)
|
||||||
@ -144,7 +139,7 @@ async def test_setup_duplicate_config(
|
|||||||
assert "duplicate host entries found" in caplog.text
|
assert "duplicate host entries found" in caplog.text
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("remote", "remotews", "remoteencws_failing")
|
@pytest.mark.usefixtures("remotews", "remoteencws_failing", "rest_api")
|
||||||
async def test_setup_duplicate_entries(hass: HomeAssistant) -> None:
|
async def test_setup_duplicate_entries(hass: HomeAssistant) -> None:
|
||||||
"""Test duplicate setup of platform."""
|
"""Test duplicate setup of platform."""
|
||||||
await async_setup_component(hass, SAMSUNGTV_DOMAIN, MOCK_CONFIG)
|
await async_setup_component(hass, SAMSUNGTV_DOMAIN, MOCK_CONFIG)
|
||||||
@ -160,9 +155,7 @@ async def test_setup_h_j_model(
|
|||||||
hass: HomeAssistant, rest_api: Mock, caplog: pytest.LogCaptureFixture
|
hass: HomeAssistant, rest_api: Mock, caplog: pytest.LogCaptureFixture
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test Samsung TV integration is setup."""
|
"""Test Samsung TV integration is setup."""
|
||||||
device_info = deepcopy(rest_api.rest_device_info.return_value)
|
rest_api.rest_device_info.return_value = SAMPLE_DEVICE_INFO_UE48JU6400
|
||||||
device_info["device"]["modelName"] = "UE48JU6400"
|
|
||||||
rest_api.rest_device_info.return_value = device_info
|
|
||||||
await async_setup_component(hass, SAMSUNGTV_DOMAIN, MOCK_CONFIG)
|
await async_setup_component(hass, SAMSUNGTV_DOMAIN, MOCK_CONFIG)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
state = hass.states.get(ENTITY_ID)
|
state = hass.states.get(ENTITY_ID)
|
||||||
@ -170,7 +163,7 @@ async def test_setup_h_j_model(
|
|||||||
assert "H and J series use an encrypted protocol" in caplog.text
|
assert "H and J series use an encrypted protocol" in caplog.text
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("remote", "remotews", "remoteencws_failing")
|
@pytest.mark.usefixtures("remotews", "remoteencws_failing", "rest_api")
|
||||||
async def test_setup_updates_from_ssdp(hass: HomeAssistant) -> None:
|
async def test_setup_updates_from_ssdp(hass: HomeAssistant) -> None:
|
||||||
"""Test setting up the entry fetches data from ssdp cache."""
|
"""Test setting up the entry fetches data from ssdp cache."""
|
||||||
entry = MockConfigEntry(domain="samsungtv", data=MOCK_ENTRYDATA_WS)
|
entry = MockConfigEntry(domain="samsungtv", data=MOCK_ENTRYDATA_WS)
|
||||||
|
@ -88,6 +88,7 @@ from . import (
|
|||||||
from .const import (
|
from .const import (
|
||||||
MOCK_ENTRYDATA_ENCRYPTED_WS,
|
MOCK_ENTRYDATA_ENCRYPTED_WS,
|
||||||
SAMPLE_DEVICE_INFO_FRAME,
|
SAMPLE_DEVICE_INFO_FRAME,
|
||||||
|
SAMPLE_DEVICE_INFO_WIFI,
|
||||||
SAMPLE_EVENT_ED_INSTALLED_APP,
|
SAMPLE_EVENT_ED_INSTALLED_APP,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -153,11 +154,6 @@ MOCK_CONFIG_NOTURNON = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="autouse_rest_api", autouse=True)
|
|
||||||
def autouse_rest_api(rest_api) -> Mock:
|
|
||||||
"""Enable auto use of the rest api fixture for these tests."""
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="delay")
|
@pytest.fixture(name="delay")
|
||||||
def delay_fixture():
|
def delay_fixture():
|
||||||
"""Patch the delay script function."""
|
"""Patch the delay script function."""
|
||||||
@ -187,7 +183,7 @@ async def test_setup_without_turnon(hass: HomeAssistant) -> None:
|
|||||||
assert hass.states.get(ENTITY_ID_NOTURNON)
|
assert hass.states.get(ENTITY_ID_NOTURNON)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("remotews")
|
@pytest.mark.usefixtures("remotews", "rest_api")
|
||||||
async def test_setup_websocket(hass: HomeAssistant) -> None:
|
async def test_setup_websocket(hass: HomeAssistant) -> None:
|
||||||
"""Test setup of platform."""
|
"""Test setup of platform."""
|
||||||
with patch(
|
with patch(
|
||||||
@ -212,6 +208,7 @@ async def test_setup_websocket(hass: HomeAssistant) -> None:
|
|||||||
assert config_entries[0].data[CONF_MAC] == "aa:bb:ww:ii:ff:ii"
|
assert config_entries[0].data[CONF_MAC] == "aa:bb:ww:ii:ff:ii"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("rest_api")
|
||||||
async def test_setup_websocket_2(hass: HomeAssistant, mock_now: datetime) -> None:
|
async def test_setup_websocket_2(hass: HomeAssistant, mock_now: datetime) -> None:
|
||||||
"""Test setup of platform from config entry."""
|
"""Test setup of platform from config entry."""
|
||||||
entity_id = f"{DOMAIN}.fake"
|
entity_id = f"{DOMAIN}.fake"
|
||||||
@ -250,6 +247,7 @@ async def test_setup_websocket_2(hass: HomeAssistant, mock_now: datetime) -> Non
|
|||||||
remote_class.assert_called_once_with(**MOCK_CALLS_WS)
|
remote_class.assert_called_once_with(**MOCK_CALLS_WS)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("rest_api")
|
||||||
async def test_setup_encrypted_websocket(
|
async def test_setup_encrypted_websocket(
|
||||||
hass: HomeAssistant, mock_now: datetime
|
hass: HomeAssistant, mock_now: datetime
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -351,7 +349,7 @@ async def test_update_off_ws_with_power_state(
|
|||||||
assert state.state == STATE_OFF
|
assert state.state == STATE_OFF
|
||||||
|
|
||||||
# First update uses start_listening once, and initialises device_info
|
# First update uses start_listening once, and initialises device_info
|
||||||
device_info = deepcopy(rest_api.rest_device_info.return_value)
|
device_info = deepcopy(SAMPLE_DEVICE_INFO_WIFI)
|
||||||
device_info["device"]["PowerState"] = "on"
|
device_info["device"]["PowerState"] = "on"
|
||||||
rest_api.rest_device_info.return_value = device_info
|
rest_api.rest_device_info.return_value = device_info
|
||||||
next_update = mock_now + timedelta(minutes=1)
|
next_update = mock_now + timedelta(minutes=1)
|
||||||
@ -447,6 +445,7 @@ async def test_update_access_denied(hass: HomeAssistant, mock_now: datetime) ->
|
|||||||
assert state.state == STATE_UNAVAILABLE
|
assert state.state == STATE_UNAVAILABLE
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("rest_api")
|
||||||
async def test_update_ws_connection_failure(
|
async def test_update_ws_connection_failure(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mock_now: datetime,
|
mock_now: datetime,
|
||||||
@ -476,6 +475,7 @@ async def test_update_ws_connection_failure(
|
|||||||
assert state.state == STATE_OFF
|
assert state.state == STATE_OFF
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("rest_api")
|
||||||
async def test_update_ws_connection_closed(
|
async def test_update_ws_connection_closed(
|
||||||
hass: HomeAssistant, mock_now: datetime, remotews: Mock
|
hass: HomeAssistant, mock_now: datetime, remotews: Mock
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -494,6 +494,7 @@ async def test_update_ws_connection_closed(
|
|||||||
assert state.state == STATE_OFF
|
assert state.state == STATE_OFF
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("rest_api")
|
||||||
async def test_update_ws_unauthorized_error(
|
async def test_update_ws_unauthorized_error(
|
||||||
hass: HomeAssistant, mock_now: datetime, remotews: Mock
|
hass: HomeAssistant, mock_now: datetime, remotews: Mock
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -627,6 +628,7 @@ async def test_send_key_unhandled_response(hass: HomeAssistant, remote: Mock) ->
|
|||||||
assert state.state == STATE_ON
|
assert state.state == STATE_ON
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("rest_api")
|
||||||
async def test_send_key_websocketexception(hass: HomeAssistant, remotews: Mock) -> None:
|
async def test_send_key_websocketexception(hass: HomeAssistant, remotews: Mock) -> None:
|
||||||
"""Testing unhandled response exception."""
|
"""Testing unhandled response exception."""
|
||||||
await setup_samsungtv(hass, MOCK_CONFIGWS)
|
await setup_samsungtv(hass, MOCK_CONFIGWS)
|
||||||
@ -638,6 +640,7 @@ async def test_send_key_websocketexception(hass: HomeAssistant, remotews: Mock)
|
|||||||
assert state.state == STATE_ON
|
assert state.state == STATE_ON
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("rest_api")
|
||||||
async def test_send_key_websocketexception_encrypted(
|
async def test_send_key_websocketexception_encrypted(
|
||||||
hass: HomeAssistant, remoteencws: Mock
|
hass: HomeAssistant, remoteencws: Mock
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -651,6 +654,7 @@ async def test_send_key_websocketexception_encrypted(
|
|||||||
assert state.state == STATE_ON
|
assert state.state == STATE_ON
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("rest_api")
|
||||||
async def test_send_key_os_error_ws(hass: HomeAssistant, remotews: Mock) -> None:
|
async def test_send_key_os_error_ws(hass: HomeAssistant, remotews: Mock) -> None:
|
||||||
"""Testing unhandled response exception."""
|
"""Testing unhandled response exception."""
|
||||||
await setup_samsungtv(hass, MOCK_CONFIGWS)
|
await setup_samsungtv(hass, MOCK_CONFIGWS)
|
||||||
@ -662,6 +666,7 @@ async def test_send_key_os_error_ws(hass: HomeAssistant, remotews: Mock) -> None
|
|||||||
assert state.state == STATE_ON
|
assert state.state == STATE_ON
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("rest_api")
|
||||||
async def test_send_key_os_error_ws_encrypted(
|
async def test_send_key_os_error_ws_encrypted(
|
||||||
hass: HomeAssistant, remoteencws: Mock
|
hass: HomeAssistant, remoteencws: Mock
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -767,6 +772,7 @@ async def test_device_class(hass: HomeAssistant) -> None:
|
|||||||
assert state.attributes[ATTR_DEVICE_CLASS] is MediaPlayerDeviceClass.TV.value
|
assert state.attributes[ATTR_DEVICE_CLASS] is MediaPlayerDeviceClass.TV.value
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("rest_api")
|
||||||
async def test_turn_off_websocket(
|
async def test_turn_off_websocket(
|
||||||
hass: HomeAssistant, remotews: Mock, caplog: pytest.LogCaptureFixture
|
hass: HomeAssistant, remotews: Mock, caplog: pytest.LogCaptureFixture
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -924,6 +930,7 @@ async def test_turn_off_os_error(
|
|||||||
assert "Could not establish connection" in caplog.text
|
assert "Could not establish connection" in caplog.text
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("rest_api")
|
||||||
async def test_turn_off_ws_os_error(
|
async def test_turn_off_ws_os_error(
|
||||||
hass: HomeAssistant, remotews: Mock, caplog: pytest.LogCaptureFixture
|
hass: HomeAssistant, remotews: Mock, caplog: pytest.LogCaptureFixture
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -937,6 +944,7 @@ async def test_turn_off_ws_os_error(
|
|||||||
assert "Error closing connection" in caplog.text
|
assert "Error closing connection" in caplog.text
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("rest_api")
|
||||||
async def test_turn_off_encryptedws_os_error(
|
async def test_turn_off_encryptedws_os_error(
|
||||||
hass: HomeAssistant, remoteencws: Mock, caplog: pytest.LogCaptureFixture
|
hass: HomeAssistant, remoteencws: Mock, caplog: pytest.LogCaptureFixture
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -1072,7 +1080,7 @@ async def test_turn_on_with_turnon(hass: HomeAssistant, delay: Mock) -> None:
|
|||||||
assert delay.call_count == 1
|
assert delay.call_count == 1
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("remotews")
|
@pytest.mark.usefixtures("remotews", "rest_api")
|
||||||
async def test_turn_on_wol(hass: HomeAssistant) -> None:
|
async def test_turn_on_wol(hass: HomeAssistant) -> None:
|
||||||
"""Test turn on."""
|
"""Test turn on."""
|
||||||
entry = MockConfigEntry(
|
entry = MockConfigEntry(
|
||||||
@ -1229,6 +1237,7 @@ async def test_select_source_invalid_source(hass: HomeAssistant) -> None:
|
|||||||
assert remote.call_count == 1
|
assert remote.call_count == 1
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("rest_api")
|
||||||
async def test_play_media_app(hass: HomeAssistant, remotews: Mock) -> None:
|
async def test_play_media_app(hass: HomeAssistant, remotews: Mock) -> None:
|
||||||
"""Test for play_media."""
|
"""Test for play_media."""
|
||||||
await setup_samsungtv(hass, MOCK_CONFIGWS)
|
await setup_samsungtv(hass, MOCK_CONFIGWS)
|
||||||
@ -1251,6 +1260,7 @@ async def test_play_media_app(hass: HomeAssistant, remotews: Mock) -> None:
|
|||||||
assert commands[0].params["data"]["appId"] == "3201608010191"
|
assert commands[0].params["data"]["appId"] == "3201608010191"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("rest_api")
|
||||||
async def test_select_source_app(hass: HomeAssistant, remotews: Mock) -> None:
|
async def test_select_source_app(hass: HomeAssistant, remotews: Mock) -> None:
|
||||||
"""Test for select_source."""
|
"""Test for select_source."""
|
||||||
remotews.app_list_data = SAMPLE_EVENT_ED_INSTALLED_APP
|
remotews.app_list_data = SAMPLE_EVENT_ED_INSTALLED_APP
|
||||||
@ -1270,6 +1280,7 @@ async def test_select_source_app(hass: HomeAssistant, remotews: Mock) -> None:
|
|||||||
assert commands[0].params["data"]["appId"] == "3201608010191"
|
assert commands[0].params["data"]["appId"] == "3201608010191"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("rest_api")
|
||||||
async def test_websocket_unsupported_remote_control(
|
async def test_websocket_unsupported_remote_control(
|
||||||
hass: HomeAssistant, remotews: Mock, caplog: pytest.LogCaptureFixture
|
hass: HomeAssistant, remotews: Mock, caplog: pytest.LogCaptureFixture
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -1318,7 +1329,7 @@ async def test_websocket_unsupported_remote_control(
|
|||||||
assert state.state == STATE_UNAVAILABLE
|
assert state.state == STATE_UNAVAILABLE
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("remotews")
|
@pytest.mark.usefixtures("remotews", "rest_api")
|
||||||
async def test_volume_control_upnp(
|
async def test_volume_control_upnp(
|
||||||
hass: HomeAssistant, upnp_device: Mock, caplog: pytest.LogCaptureFixture
|
hass: HomeAssistant, upnp_device: Mock, caplog: pytest.LogCaptureFixture
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -1362,7 +1373,7 @@ async def test_volume_control_upnp(
|
|||||||
assert "Unable to set volume level on" in caplog.text
|
assert "Unable to set volume level on" in caplog.text
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("remotews")
|
@pytest.mark.usefixtures("remotews", "rest_api")
|
||||||
async def test_upnp_not_available(
|
async def test_upnp_not_available(
|
||||||
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
|
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -1379,7 +1390,7 @@ async def test_upnp_not_available(
|
|||||||
assert "Upnp services are not available" in caplog.text
|
assert "Upnp services are not available" in caplog.text
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("remotews", "upnp_device")
|
@pytest.mark.usefixtures("remotews", "upnp_device", "rest_api")
|
||||||
async def test_upnp_missing_service(
|
async def test_upnp_missing_service(
|
||||||
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
|
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
|
||||||
) -> None:
|
) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user