mirror of
https://github.com/home-assistant/core.git
synced 2026-05-08 17:49:37 +01:00
Fix lg_netcast tests opening sockets (#156459)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
"""The tests for LG NEtcast device triggers."""
|
||||
"""The tests for LG Netcast device triggers."""
|
||||
|
||||
from collections.abc import Generator
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -19,6 +22,13 @@ from . import ENTITY_ID, UNIQUE_ID, setup_lgnetcast
|
||||
from tests.common import MockConfigEntry, async_get_device_automations
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_lg_netcast() -> Generator[None]:
|
||||
"""Mock LG Netcast library."""
|
||||
with patch("homeassistant.components.lg_netcast.LgNetCastClient"):
|
||||
yield
|
||||
|
||||
|
||||
async def test_get_triggers(
|
||||
hass: HomeAssistant, device_registry: dr.DeviceRegistry
|
||||
) -> None:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"""The tests for LG Netcast device triggers."""
|
||||
|
||||
from collections.abc import Generator
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
@@ -17,6 +18,13 @@ from . import ENTITY_ID, UNIQUE_ID, setup_lgnetcast
|
||||
from tests.common import MockEntity, MockEntityPlatform
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_lg_netcast() -> Generator[None]:
|
||||
"""Mock LG Netcast library."""
|
||||
with patch("homeassistant.components.lg_netcast.LgNetCastClient"):
|
||||
yield
|
||||
|
||||
|
||||
async def test_lg_netcast_turn_on_trigger_device_id(
|
||||
hass: HomeAssistant,
|
||||
service_calls: list[ServiceCall],
|
||||
|
||||
Reference in New Issue
Block a user