mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Use freezegun in devolo_home_network tests (#99029)
This commit is contained in:
parent
346674a1a8
commit
943db9e0d5
@ -2,6 +2,7 @@
|
|||||||
from unittest.mock import AsyncMock
|
from unittest.mock import AsyncMock
|
||||||
|
|
||||||
from devolo_plc_api.exceptions.device import DeviceUnavailable
|
from devolo_plc_api.exceptions.device import DeviceUnavailable
|
||||||
|
from freezegun.api import FrozenDateTimeFactory
|
||||||
import pytest
|
import pytest
|
||||||
from syrupy.assertion import SnapshotAssertion
|
from syrupy.assertion import SnapshotAssertion
|
||||||
|
|
||||||
@ -13,7 +14,6 @@ from homeassistant.components.devolo_home_network.const import (
|
|||||||
from homeassistant.const import STATE_ON, STATE_UNAVAILABLE
|
from homeassistant.const import STATE_ON, STATE_UNAVAILABLE
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
from homeassistant.util import dt as dt_util
|
|
||||||
|
|
||||||
from . import configure_integration
|
from . import configure_integration
|
||||||
from .const import PLCNET_ATTACHED
|
from .const import PLCNET_ATTACHED
|
||||||
@ -40,6 +40,7 @@ async def test_update_attached_to_router(
|
|||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mock_device: MockDevice,
|
mock_device: MockDevice,
|
||||||
entity_registry: er.EntityRegistry,
|
entity_registry: er.EntityRegistry,
|
||||||
|
freezer: FrozenDateTimeFactory,
|
||||||
snapshot: SnapshotAssertion,
|
snapshot: SnapshotAssertion,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test state change of a attached_to_router binary sensor device."""
|
"""Test state change of a attached_to_router binary sensor device."""
|
||||||
@ -57,7 +58,8 @@ async def test_update_attached_to_router(
|
|||||||
mock_device.plcnet.async_get_network_overview = AsyncMock(
|
mock_device.plcnet.async_get_network_overview = AsyncMock(
|
||||||
side_effect=DeviceUnavailable
|
side_effect=DeviceUnavailable
|
||||||
)
|
)
|
||||||
async_fire_time_changed(hass, dt_util.utcnow() + LONG_UPDATE_INTERVAL)
|
freezer.tick(LONG_UPDATE_INTERVAL)
|
||||||
|
async_fire_time_changed(hass)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
state = hass.states.get(state_key)
|
state = hass.states.get(state_key)
|
||||||
@ -68,7 +70,8 @@ async def test_update_attached_to_router(
|
|||||||
mock_device.plcnet.async_get_network_overview = AsyncMock(
|
mock_device.plcnet.async_get_network_overview = AsyncMock(
|
||||||
return_value=PLCNET_ATTACHED
|
return_value=PLCNET_ATTACHED
|
||||||
)
|
)
|
||||||
async_fire_time_changed(hass, dt_util.utcnow() + LONG_UPDATE_INTERVAL)
|
freezer.tick(LONG_UPDATE_INTERVAL)
|
||||||
|
async_fire_time_changed(hass)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
state = hass.states.get(state_key)
|
state = hass.states.get(state_key)
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
from unittest.mock import AsyncMock
|
from unittest.mock import AsyncMock
|
||||||
|
|
||||||
from devolo_plc_api.exceptions.device import DeviceUnavailable
|
from devolo_plc_api.exceptions.device import DeviceUnavailable
|
||||||
|
from freezegun.api import FrozenDateTimeFactory
|
||||||
from syrupy.assertion import SnapshotAssertion
|
from syrupy.assertion import SnapshotAssertion
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import DOMAIN as PLATFORM
|
from homeassistant.components.device_tracker import DOMAIN as PLATFORM
|
||||||
@ -12,7 +13,6 @@ from homeassistant.components.devolo_home_network.const import (
|
|||||||
from homeassistant.const import STATE_NOT_HOME, STATE_UNAVAILABLE
|
from homeassistant.const import STATE_NOT_HOME, STATE_UNAVAILABLE
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
from homeassistant.util import dt as dt_util
|
|
||||||
|
|
||||||
from . import configure_integration
|
from . import configure_integration
|
||||||
from .const import CONNECTED_STATIONS, DISCOVERY_INFO, NO_CONNECTED_STATIONS
|
from .const import CONNECTED_STATIONS, DISCOVERY_INFO, NO_CONNECTED_STATIONS
|
||||||
@ -28,6 +28,7 @@ async def test_device_tracker(
|
|||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mock_device: MockDevice,
|
mock_device: MockDevice,
|
||||||
entity_registry: er.EntityRegistry,
|
entity_registry: er.EntityRegistry,
|
||||||
|
freezer: FrozenDateTimeFactory,
|
||||||
snapshot: SnapshotAssertion,
|
snapshot: SnapshotAssertion,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test device tracker states."""
|
"""Test device tracker states."""
|
||||||
@ -37,13 +38,15 @@ async def test_device_tracker(
|
|||||||
entry = configure_integration(hass)
|
entry = configure_integration(hass)
|
||||||
await hass.config_entries.async_setup(entry.entry_id)
|
await hass.config_entries.async_setup(entry.entry_id)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
async_fire_time_changed(hass, dt_util.utcnow() + LONG_UPDATE_INTERVAL)
|
freezer.tick(LONG_UPDATE_INTERVAL)
|
||||||
|
async_fire_time_changed(hass)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
# Enable entity
|
# Enable entity
|
||||||
entity_registry.async_update_entity(state_key, disabled_by=None)
|
entity_registry.async_update_entity(state_key, disabled_by=None)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
async_fire_time_changed(hass, dt_util.utcnow() + LONG_UPDATE_INTERVAL)
|
freezer.tick(LONG_UPDATE_INTERVAL)
|
||||||
|
async_fire_time_changed(hass)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
assert hass.states.get(state_key) == snapshot
|
assert hass.states.get(state_key) == snapshot
|
||||||
@ -52,7 +55,8 @@ async def test_device_tracker(
|
|||||||
mock_device.device.async_get_wifi_connected_station = AsyncMock(
|
mock_device.device.async_get_wifi_connected_station = AsyncMock(
|
||||||
return_value=NO_CONNECTED_STATIONS
|
return_value=NO_CONNECTED_STATIONS
|
||||||
)
|
)
|
||||||
async_fire_time_changed(hass, dt_util.utcnow() + LONG_UPDATE_INTERVAL)
|
freezer.tick(LONG_UPDATE_INTERVAL)
|
||||||
|
async_fire_time_changed(hass)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
state = hass.states.get(state_key)
|
state = hass.states.get(state_key)
|
||||||
@ -63,7 +67,8 @@ async def test_device_tracker(
|
|||||||
mock_device.device.async_get_wifi_connected_station = AsyncMock(
|
mock_device.device.async_get_wifi_connected_station = AsyncMock(
|
||||||
side_effect=DeviceUnavailable
|
side_effect=DeviceUnavailable
|
||||||
)
|
)
|
||||||
async_fire_time_changed(hass, dt_util.utcnow() + LONG_UPDATE_INTERVAL)
|
freezer.tick(LONG_UPDATE_INTERVAL)
|
||||||
|
async_fire_time_changed(hass)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
state = hass.states.get(state_key)
|
state = hass.states.get(state_key)
|
||||||
|
@ -3,6 +3,7 @@ from datetime import timedelta
|
|||||||
from unittest.mock import AsyncMock
|
from unittest.mock import AsyncMock
|
||||||
|
|
||||||
from devolo_plc_api.exceptions.device import DeviceUnavailable
|
from devolo_plc_api.exceptions.device import DeviceUnavailable
|
||||||
|
from freezegun.api import FrozenDateTimeFactory
|
||||||
import pytest
|
import pytest
|
||||||
from syrupy.assertion import SnapshotAssertion
|
from syrupy.assertion import SnapshotAssertion
|
||||||
|
|
||||||
@ -14,7 +15,6 @@ from homeassistant.components.sensor import DOMAIN
|
|||||||
from homeassistant.const import STATE_UNAVAILABLE
|
from homeassistant.const import STATE_UNAVAILABLE
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
from homeassistant.util import dt as dt_util
|
|
||||||
|
|
||||||
from . import configure_integration
|
from . import configure_integration
|
||||||
from .mock import MockDevice
|
from .mock import MockDevice
|
||||||
@ -62,6 +62,7 @@ async def test_sensor(
|
|||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mock_device: MockDevice,
|
mock_device: MockDevice,
|
||||||
entity_registry: er.EntityRegistry,
|
entity_registry: er.EntityRegistry,
|
||||||
|
freezer: FrozenDateTimeFactory,
|
||||||
snapshot: SnapshotAssertion,
|
snapshot: SnapshotAssertion,
|
||||||
name: str,
|
name: str,
|
||||||
get_method: str,
|
get_method: str,
|
||||||
@ -80,7 +81,8 @@ async def test_sensor(
|
|||||||
# Emulate device failure
|
# Emulate device failure
|
||||||
setattr(mock_device.device, get_method, AsyncMock(side_effect=DeviceUnavailable))
|
setattr(mock_device.device, get_method, AsyncMock(side_effect=DeviceUnavailable))
|
||||||
setattr(mock_device.plcnet, get_method, AsyncMock(side_effect=DeviceUnavailable))
|
setattr(mock_device.plcnet, get_method, AsyncMock(side_effect=DeviceUnavailable))
|
||||||
async_fire_time_changed(hass, dt_util.utcnow() + interval)
|
freezer.tick(interval)
|
||||||
|
async_fire_time_changed(hass)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
state = hass.states.get(state_key)
|
state = hass.states.get(state_key)
|
||||||
@ -89,7 +91,8 @@ async def test_sensor(
|
|||||||
|
|
||||||
# Emulate state change
|
# Emulate state change
|
||||||
mock_device.reset()
|
mock_device.reset()
|
||||||
async_fire_time_changed(hass, dt_util.utcnow() + interval)
|
freezer.tick(interval)
|
||||||
|
async_fire_time_changed(hass)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
state = hass.states.get(state_key)
|
state = hass.states.get(state_key)
|
||||||
|
@ -4,6 +4,7 @@ from unittest.mock import AsyncMock, patch
|
|||||||
|
|
||||||
from devolo_plc_api.device_api import WifiGuestAccessGet
|
from devolo_plc_api.device_api import WifiGuestAccessGet
|
||||||
from devolo_plc_api.exceptions.device import DevicePasswordProtected, DeviceUnavailable
|
from devolo_plc_api.exceptions.device import DevicePasswordProtected, DeviceUnavailable
|
||||||
|
from freezegun.api import FrozenDateTimeFactory
|
||||||
import pytest
|
import pytest
|
||||||
from syrupy.assertion import SnapshotAssertion
|
from syrupy.assertion import SnapshotAssertion
|
||||||
|
|
||||||
@ -24,7 +25,6 @@ from homeassistant.core import HomeAssistant
|
|||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
from homeassistant.helpers.update_coordinator import REQUEST_REFRESH_DEFAULT_COOLDOWN
|
from homeassistant.helpers.update_coordinator import REQUEST_REFRESH_DEFAULT_COOLDOWN
|
||||||
from homeassistant.util import dt as dt_util
|
|
||||||
|
|
||||||
from . import configure_integration
|
from . import configure_integration
|
||||||
from .mock import MockDevice
|
from .mock import MockDevice
|
||||||
@ -75,6 +75,7 @@ async def test_update_enable_guest_wifi(
|
|||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mock_device: MockDevice,
|
mock_device: MockDevice,
|
||||||
entity_registry: er.EntityRegistry,
|
entity_registry: er.EntityRegistry,
|
||||||
|
freezer: FrozenDateTimeFactory,
|
||||||
snapshot: SnapshotAssertion,
|
snapshot: SnapshotAssertion,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test state change of a enable_guest_wifi switch device."""
|
"""Test state change of a enable_guest_wifi switch device."""
|
||||||
@ -92,7 +93,8 @@ async def test_update_enable_guest_wifi(
|
|||||||
mock_device.device.async_get_wifi_guest_access.return_value = WifiGuestAccessGet(
|
mock_device.device.async_get_wifi_guest_access.return_value = WifiGuestAccessGet(
|
||||||
enabled=True
|
enabled=True
|
||||||
)
|
)
|
||||||
async_fire_time_changed(hass, dt_util.utcnow() + SHORT_UPDATE_INTERVAL)
|
freezer.tick(SHORT_UPDATE_INTERVAL)
|
||||||
|
async_fire_time_changed(hass)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
state = hass.states.get(state_key)
|
state = hass.states.get(state_key)
|
||||||
@ -116,9 +118,8 @@ async def test_update_enable_guest_wifi(
|
|||||||
assert state.state == STATE_OFF
|
assert state.state == STATE_OFF
|
||||||
turn_off.assert_called_once_with(False)
|
turn_off.assert_called_once_with(False)
|
||||||
|
|
||||||
async_fire_time_changed(
|
freezer.tick(REQUEST_REFRESH_DEFAULT_COOLDOWN)
|
||||||
hass, dt_util.utcnow() + timedelta(seconds=REQUEST_REFRESH_DEFAULT_COOLDOWN)
|
async_fire_time_changed(hass)
|
||||||
)
|
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
# Switch on
|
# Switch on
|
||||||
@ -138,9 +139,8 @@ async def test_update_enable_guest_wifi(
|
|||||||
assert state.state == STATE_ON
|
assert state.state == STATE_ON
|
||||||
turn_on.assert_called_once_with(True)
|
turn_on.assert_called_once_with(True)
|
||||||
|
|
||||||
async_fire_time_changed(
|
freezer.tick(REQUEST_REFRESH_DEFAULT_COOLDOWN)
|
||||||
hass, dt_util.utcnow() + timedelta(seconds=REQUEST_REFRESH_DEFAULT_COOLDOWN)
|
async_fire_time_changed(hass)
|
||||||
)
|
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
# Device unavailable
|
# Device unavailable
|
||||||
@ -164,6 +164,7 @@ async def test_update_enable_leds(
|
|||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mock_device: MockDevice,
|
mock_device: MockDevice,
|
||||||
entity_registry: er.EntityRegistry,
|
entity_registry: er.EntityRegistry,
|
||||||
|
freezer: FrozenDateTimeFactory,
|
||||||
snapshot: SnapshotAssertion,
|
snapshot: SnapshotAssertion,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test state change of a enable_leds switch device."""
|
"""Test state change of a enable_leds switch device."""
|
||||||
@ -179,7 +180,8 @@ async def test_update_enable_leds(
|
|||||||
|
|
||||||
# Emulate state change
|
# Emulate state change
|
||||||
mock_device.device.async_get_led_setting.return_value = True
|
mock_device.device.async_get_led_setting.return_value = True
|
||||||
async_fire_time_changed(hass, dt_util.utcnow() + SHORT_UPDATE_INTERVAL)
|
freezer.tick(SHORT_UPDATE_INTERVAL)
|
||||||
|
async_fire_time_changed(hass)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
state = hass.states.get(state_key)
|
state = hass.states.get(state_key)
|
||||||
@ -201,9 +203,8 @@ async def test_update_enable_leds(
|
|||||||
assert state.state == STATE_OFF
|
assert state.state == STATE_OFF
|
||||||
turn_off.assert_called_once_with(False)
|
turn_off.assert_called_once_with(False)
|
||||||
|
|
||||||
async_fire_time_changed(
|
freezer.tick(REQUEST_REFRESH_DEFAULT_COOLDOWN)
|
||||||
hass, dt_util.utcnow() + timedelta(seconds=REQUEST_REFRESH_DEFAULT_COOLDOWN)
|
async_fire_time_changed(hass)
|
||||||
)
|
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
# Switch on
|
# Switch on
|
||||||
@ -221,9 +222,8 @@ async def test_update_enable_leds(
|
|||||||
assert state.state == STATE_ON
|
assert state.state == STATE_ON
|
||||||
turn_on.assert_called_once_with(True)
|
turn_on.assert_called_once_with(True)
|
||||||
|
|
||||||
async_fire_time_changed(
|
freezer.tick(REQUEST_REFRESH_DEFAULT_COOLDOWN)
|
||||||
hass, dt_util.utcnow() + timedelta(seconds=REQUEST_REFRESH_DEFAULT_COOLDOWN)
|
async_fire_time_changed(hass)
|
||||||
)
|
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
# Device unavailable
|
# Device unavailable
|
||||||
@ -253,6 +253,7 @@ async def test_update_enable_leds(
|
|||||||
async def test_device_failure(
|
async def test_device_failure(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mock_device: MockDevice,
|
mock_device: MockDevice,
|
||||||
|
freezer: FrozenDateTimeFactory,
|
||||||
name: str,
|
name: str,
|
||||||
get_method: str,
|
get_method: str,
|
||||||
update_interval: timedelta,
|
update_interval: timedelta,
|
||||||
@ -270,7 +271,8 @@ async def test_device_failure(
|
|||||||
|
|
||||||
api = getattr(mock_device.device, get_method)
|
api = getattr(mock_device.device, get_method)
|
||||||
api.side_effect = DeviceUnavailable
|
api.side_effect = DeviceUnavailable
|
||||||
async_fire_time_changed(hass, dt_util.utcnow() + update_interval)
|
freezer.tick(update_interval)
|
||||||
|
async_fire_time_changed(hass)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
state = hass.states.get(state_key)
|
state = hass.states.get(state_key)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Tests for the devolo Home Network update."""
|
"""Tests for the devolo Home Network update."""
|
||||||
from devolo_plc_api.device_api import UPDATE_NOT_AVAILABLE, UpdateFirmwareCheck
|
from devolo_plc_api.device_api import UPDATE_NOT_AVAILABLE, UpdateFirmwareCheck
|
||||||
from devolo_plc_api.exceptions.device import DevicePasswordProtected, DeviceUnavailable
|
from devolo_plc_api.exceptions.device import DevicePasswordProtected, DeviceUnavailable
|
||||||
|
from freezegun.api import FrozenDateTimeFactory
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from homeassistant.components.devolo_home_network.const import (
|
from homeassistant.components.devolo_home_network.const import (
|
||||||
@ -18,7 +19,6 @@ from homeassistant.core import HomeAssistant
|
|||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
from homeassistant.helpers.entity import EntityCategory
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
from homeassistant.util import dt as dt_util
|
|
||||||
|
|
||||||
from . import configure_integration
|
from . import configure_integration
|
||||||
from .const import FIRMWARE_UPDATE_AVAILABLE
|
from .const import FIRMWARE_UPDATE_AVAILABLE
|
||||||
@ -41,7 +41,10 @@ async def test_update_setup(hass: HomeAssistant) -> None:
|
|||||||
|
|
||||||
|
|
||||||
async def test_update_firmware(
|
async def test_update_firmware(
|
||||||
hass: HomeAssistant, mock_device: MockDevice, entity_registry: er.EntityRegistry
|
hass: HomeAssistant,
|
||||||
|
mock_device: MockDevice,
|
||||||
|
entity_registry: er.EntityRegistry,
|
||||||
|
freezer: FrozenDateTimeFactory,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test updating a device."""
|
"""Test updating a device."""
|
||||||
entry = configure_integration(hass)
|
entry = configure_integration(hass)
|
||||||
@ -75,7 +78,8 @@ async def test_update_firmware(
|
|||||||
mock_device.device.async_check_firmware_available.return_value = (
|
mock_device.device.async_check_firmware_available.return_value = (
|
||||||
UpdateFirmwareCheck(result=UPDATE_NOT_AVAILABLE)
|
UpdateFirmwareCheck(result=UPDATE_NOT_AVAILABLE)
|
||||||
)
|
)
|
||||||
async_fire_time_changed(hass, dt_util.utcnow() + LONG_UPDATE_INTERVAL)
|
freezer.tick(LONG_UPDATE_INTERVAL)
|
||||||
|
async_fire_time_changed(hass)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
state = hass.states.get(state_key)
|
state = hass.states.get(state_key)
|
||||||
@ -86,7 +90,9 @@ async def test_update_firmware(
|
|||||||
|
|
||||||
|
|
||||||
async def test_device_failure_check(
|
async def test_device_failure_check(
|
||||||
hass: HomeAssistant, mock_device: MockDevice
|
hass: HomeAssistant,
|
||||||
|
mock_device: MockDevice,
|
||||||
|
freezer: FrozenDateTimeFactory,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test device failure during check."""
|
"""Test device failure during check."""
|
||||||
entry = configure_integration(hass)
|
entry = configure_integration(hass)
|
||||||
@ -100,7 +106,8 @@ async def test_device_failure_check(
|
|||||||
assert state is not None
|
assert state is not None
|
||||||
|
|
||||||
mock_device.device.async_check_firmware_available.side_effect = DeviceUnavailable
|
mock_device.device.async_check_firmware_available.side_effect = DeviceUnavailable
|
||||||
async_fire_time_changed(hass, dt_util.utcnow() + LONG_UPDATE_INTERVAL)
|
freezer.tick(LONG_UPDATE_INTERVAL)
|
||||||
|
async_fire_time_changed(hass)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
state = hass.states.get(state_key)
|
state = hass.states.get(state_key)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user