mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Add type hints to helper tests (#89784)
This commit is contained in:
@@ -10,6 +10,7 @@ from astral import LocationInfo
|
||||
import astral.sun
|
||||
import async_timeout
|
||||
from freezegun import freeze_time
|
||||
from freezegun.api import FrozenDateTimeFactory
|
||||
import jinja2
|
||||
import pytest
|
||||
|
||||
@@ -1406,7 +1407,7 @@ async def test_track_template_result_super_template_initially_false(
|
||||
],
|
||||
)
|
||||
async def test_track_template_result_super_template_2(
|
||||
hass: HomeAssistant, availability_template
|
||||
hass: HomeAssistant, availability_template: str
|
||||
) -> None:
|
||||
"""Test tracking template with super template listening to different entities."""
|
||||
specific_runs = []
|
||||
@@ -1545,7 +1546,7 @@ async def test_track_template_result_super_template_2(
|
||||
],
|
||||
)
|
||||
async def test_track_template_result_super_template_2_initially_false(
|
||||
hass: HomeAssistant, availability_template
|
||||
hass: HomeAssistant, availability_template: str
|
||||
) -> None:
|
||||
"""Test tracking template with super template listening to different entities."""
|
||||
specific_runs = []
|
||||
@@ -3898,7 +3899,9 @@ async def test_periodic_task_duplicate_time(hass: HomeAssistant) -> None:
|
||||
|
||||
# DST starts early morning March 28th 2021
|
||||
@pytest.mark.freeze_time("2021-03-28 01:28:00+01:00")
|
||||
async def test_periodic_task_entering_dst(hass: HomeAssistant, freezer) -> None:
|
||||
async def test_periodic_task_entering_dst(
|
||||
hass: HomeAssistant, freezer: FrozenDateTimeFactory
|
||||
) -> None:
|
||||
"""Test periodic task behavior when entering dst."""
|
||||
hass.config.set_time_zone("Europe/Vienna")
|
||||
specific_runs = []
|
||||
@@ -3944,7 +3947,9 @@ async def test_periodic_task_entering_dst(hass: HomeAssistant, freezer) -> None:
|
||||
|
||||
# DST starts early morning March 28th 2021
|
||||
@pytest.mark.freeze_time("2021-03-28 01:59:59+01:00")
|
||||
async def test_periodic_task_entering_dst_2(hass: HomeAssistant, freezer) -> None:
|
||||
async def test_periodic_task_entering_dst_2(
|
||||
hass: HomeAssistant, freezer: FrozenDateTimeFactory
|
||||
) -> None:
|
||||
"""Test periodic task behavior when entering dst.
|
||||
|
||||
This tests a task firing every second in the range 0..58 (not *:*:59)
|
||||
@@ -3995,7 +4000,9 @@ async def test_periodic_task_entering_dst_2(hass: HomeAssistant, freezer) -> Non
|
||||
|
||||
# DST ends early morning October 31st 2021
|
||||
@pytest.mark.freeze_time("2021-10-31 02:28:00+02:00")
|
||||
async def test_periodic_task_leaving_dst(hass: HomeAssistant, freezer) -> None:
|
||||
async def test_periodic_task_leaving_dst(
|
||||
hass: HomeAssistant, freezer: FrozenDateTimeFactory
|
||||
) -> None:
|
||||
"""Test periodic task behavior when leaving dst."""
|
||||
hass.config.set_time_zone("Europe/Vienna")
|
||||
specific_runs = []
|
||||
@@ -4069,7 +4076,9 @@ async def test_periodic_task_leaving_dst(hass: HomeAssistant, freezer) -> None:
|
||||
|
||||
# DST ends early morning October 31st 2021
|
||||
@pytest.mark.freeze_time("2021-10-31 02:28:00+02:00")
|
||||
async def test_periodic_task_leaving_dst_2(hass: HomeAssistant, freezer) -> None:
|
||||
async def test_periodic_task_leaving_dst_2(
|
||||
hass: HomeAssistant, freezer: FrozenDateTimeFactory
|
||||
) -> None:
|
||||
"""Test periodic task behavior when leaving dst."""
|
||||
hass.config.set_time_zone("Europe/Vienna")
|
||||
specific_runs = []
|
||||
|
||||
Reference in New Issue
Block a user