Add type hints to integration tests (m-p) (#87705)
This commit is contained in:
parent
6551eb168d
commit
3abf7ea18a
99 changed files with 637 additions and 438 deletions
|
@ -7,6 +7,7 @@ from homeassistant.components.air_quality import DOMAIN as AIR_QUALITY_PLATFORM
|
|||
from homeassistant.components.nam.const import DOMAIN
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.const import STATE_UNAVAILABLE
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
|
||||
from . import init_integration
|
||||
|
@ -14,7 +15,7 @@ from . import init_integration
|
|||
from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
async def test_async_setup_entry(hass):
|
||||
async def test_async_setup_entry(hass: HomeAssistant) -> None:
|
||||
"""Test a successful setup entry."""
|
||||
await init_integration(hass)
|
||||
|
||||
|
@ -24,7 +25,7 @@ async def test_async_setup_entry(hass):
|
|||
assert state.state == "11.0"
|
||||
|
||||
|
||||
async def test_config_not_ready(hass):
|
||||
async def test_config_not_ready(hass: HomeAssistant) -> None:
|
||||
"""Test for setup failure if the connection to the device fails."""
|
||||
entry = MockConfigEntry(
|
||||
domain=DOMAIN,
|
||||
|
@ -42,7 +43,7 @@ async def test_config_not_ready(hass):
|
|||
assert entry.state is ConfigEntryState.SETUP_RETRY
|
||||
|
||||
|
||||
async def test_config_not_ready_while_checking_credentials(hass):
|
||||
async def test_config_not_ready_while_checking_credentials(hass: HomeAssistant) -> None:
|
||||
"""Test for setup failure if the connection fails while checking credentials."""
|
||||
entry = MockConfigEntry(
|
||||
domain=DOMAIN,
|
||||
|
@ -60,7 +61,7 @@ async def test_config_not_ready_while_checking_credentials(hass):
|
|||
assert entry.state is ConfigEntryState.SETUP_RETRY
|
||||
|
||||
|
||||
async def test_config_auth_failed(hass):
|
||||
async def test_config_auth_failed(hass: HomeAssistant) -> None:
|
||||
"""Test for setup failure if the auth fails."""
|
||||
entry = MockConfigEntry(
|
||||
domain=DOMAIN,
|
||||
|
@ -78,7 +79,7 @@ async def test_config_auth_failed(hass):
|
|||
assert entry.state is ConfigEntryState.SETUP_ERROR
|
||||
|
||||
|
||||
async def test_unload_entry(hass):
|
||||
async def test_unload_entry(hass: HomeAssistant) -> None:
|
||||
"""Test successful unload of entry."""
|
||||
entry = await init_integration(hass)
|
||||
|
||||
|
@ -92,7 +93,7 @@ async def test_unload_entry(hass):
|
|||
assert not hass.data.get(DOMAIN)
|
||||
|
||||
|
||||
async def test_remove_air_quality_entities(hass):
|
||||
async def test_remove_air_quality_entities(hass: HomeAssistant) -> None:
|
||||
"""Test remove air_quality entities from registry."""
|
||||
registry = er.async_get(hass)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue