mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Add type hints to integration tests (m-p) (#87705)
This commit is contained in:
@@ -25,6 +25,7 @@ from homeassistant.const import (
|
||||
UnitOfPressure,
|
||||
UnitOfTemperature,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.util.dt import utcnow
|
||||
@@ -34,7 +35,7 @@ from . import INCOMPLETE_NAM_DATA, init_integration, nam_data
|
||||
from tests.common import async_fire_time_changed
|
||||
|
||||
|
||||
async def test_sensor(hass):
|
||||
async def test_sensor(hass: HomeAssistant) -> None:
|
||||
"""Test states of the air_quality."""
|
||||
registry = er.async_get(hass)
|
||||
|
||||
@@ -466,7 +467,7 @@ async def test_sensor(hass):
|
||||
assert entry.unique_id == "aa:bb:cc:dd:ee:ff-mhz14a_carbon_dioxide"
|
||||
|
||||
|
||||
async def test_sensor_disabled(hass):
|
||||
async def test_sensor_disabled(hass: HomeAssistant) -> None:
|
||||
"""Test sensor disabled by default."""
|
||||
await init_integration(hass)
|
||||
registry = er.async_get(hass)
|
||||
@@ -486,7 +487,7 @@ async def test_sensor_disabled(hass):
|
||||
assert updated_entry.disabled is False
|
||||
|
||||
|
||||
async def test_incompleta_data_after_device_restart(hass):
|
||||
async def test_incompleta_data_after_device_restart(hass: HomeAssistant) -> None:
|
||||
"""Test states of the air_quality after device restart."""
|
||||
await init_integration(hass)
|
||||
|
||||
@@ -510,7 +511,7 @@ async def test_incompleta_data_after_device_restart(hass):
|
||||
assert state.state == STATE_UNAVAILABLE
|
||||
|
||||
|
||||
async def test_availability(hass):
|
||||
async def test_availability(hass: HomeAssistant) -> None:
|
||||
"""Ensure that we mark the entities unavailable correctly when device causes an error."""
|
||||
await init_integration(hass)
|
||||
|
||||
@@ -546,7 +547,7 @@ async def test_availability(hass):
|
||||
assert state.state == "7.6"
|
||||
|
||||
|
||||
async def test_manual_update_entity(hass):
|
||||
async def test_manual_update_entity(hass: HomeAssistant) -> None:
|
||||
"""Test manual update entity via service homeasasistant/update_entity."""
|
||||
await init_integration(hass)
|
||||
|
||||
@@ -567,7 +568,7 @@ async def test_manual_update_entity(hass):
|
||||
assert mock_get_data.call_count == 1
|
||||
|
||||
|
||||
async def test_unique_id_migration(hass):
|
||||
async def test_unique_id_migration(hass: HomeAssistant) -> None:
|
||||
"""Test states of the unique_id migration."""
|
||||
registry = er.async_get(hass)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user