mirror of
https://github.com/home-assistant/core.git
synced 2026-03-01 14:25:31 +00:00
* 17Track tests * add 17Track sensor to coverage * extract repeated code * 1. _goto_future - call tick only once 2. change test name to reflect test 3. remove ifs from test * remove undersocre from _goto_future
26 lines
890 B
Python
26 lines
890 B
Python
"""Tests for the seventeentrack component."""
|
|
|
|
from datetime import timedelta
|
|
|
|
from freezegun.api import FrozenDateTimeFactory
|
|
|
|
from homeassistant.components.seventeentrack.sensor import DEFAULT_SCAN_INTERVAL
|
|
from homeassistant.core import HomeAssistant
|
|
from homeassistant.helpers.typing import ConfigType
|
|
from homeassistant.setup import async_setup_component
|
|
|
|
from tests.common import async_fire_time_changed
|
|
|
|
|
|
async def init_integration(hass: HomeAssistant, config: ConfigType):
|
|
"""Set up the seventeentrack integration in Home Assistant."""
|
|
assert await async_setup_component(hass, "sensor", config)
|
|
await hass.async_block_till_done()
|
|
|
|
|
|
async def goto_future(hass: HomeAssistant, freezer: FrozenDateTimeFactory):
|
|
"""Move to future."""
|
|
freezer.tick(DEFAULT_SCAN_INTERVAL + timedelta(minutes=1))
|
|
async_fire_time_changed(hass)
|
|
await hass.async_block_till_done()
|