mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Add type hints to integration tests (h-i) (#87703)
This commit is contained in:
@@ -14,7 +14,7 @@ from homeassistant.const import (
|
||||
SERVICE_RELOAD,
|
||||
STATE_UNKNOWN,
|
||||
)
|
||||
from homeassistant.core import Context, CoreState, State
|
||||
from homeassistant.core import Context, CoreState, HomeAssistant, State
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
from homeassistant.helpers.event import async_track_state_change
|
||||
from homeassistant.setup import async_setup_component
|
||||
@@ -44,7 +44,7 @@ def storage_setup(hass, hass_storage):
|
||||
return _storage
|
||||
|
||||
|
||||
async def test_config(hass):
|
||||
async def test_config(hass: HomeAssistant) -> None:
|
||||
"""Test config."""
|
||||
invalid_configs = [None, 1, {}, {"name with space": None}]
|
||||
|
||||
@@ -52,7 +52,7 @@ async def test_config(hass):
|
||||
assert not await async_setup_component(hass, DOMAIN, {DOMAIN: cfg})
|
||||
|
||||
|
||||
async def test_config_options(hass):
|
||||
async def test_config_options(hass: HomeAssistant) -> None:
|
||||
"""Test configuration options."""
|
||||
count_start = len(hass.states.async_entity_ids())
|
||||
|
||||
@@ -88,7 +88,7 @@ async def test_config_options(hass):
|
||||
assert state_2.attributes.get(ATTR_ICON) == "mdi:work"
|
||||
|
||||
|
||||
async def test_restore_state(hass):
|
||||
async def test_restore_state(hass: HomeAssistant) -> None:
|
||||
"""Ensure states are restored on startup."""
|
||||
mock_restore_cache(
|
||||
hass,
|
||||
|
||||
Reference in New Issue
Block a user