Add type hints to integration tests (part 17) (#88163)

This commit is contained in:
epenet 2023-02-15 11:14:04 +01:00 committed by GitHub
parent 04e9c7748f
commit 2cdc741900
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 469 additions and 251 deletions

View file

@ -11,7 +11,7 @@ from . import create_entry, patch_radarr, setup_integration
from tests.test_util.aiohttp import AiohttpClientMocker
async def test_setup(hass: HomeAssistant, aioclient_mock: AiohttpClientMocker):
async def test_setup(hass: HomeAssistant, aioclient_mock: AiohttpClientMocker) -> None:
"""Test unload."""
entry = await setup_integration(hass, aioclient_mock)
assert entry.state == ConfigEntryState.LOADED
@ -25,7 +25,7 @@ async def test_setup(hass: HomeAssistant, aioclient_mock: AiohttpClientMocker):
async def test_async_setup_entry_not_ready(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
):
) -> None:
"""Test that it throws ConfigEntryNotReady when exception occurs during setup."""
entry = await setup_integration(hass, aioclient_mock, connection_error=True)
assert len(hass.config_entries.async_entries(DOMAIN)) == 1
@ -33,7 +33,7 @@ async def test_async_setup_entry_not_ready(
assert not hass.data.get(DOMAIN)
async def test_async_setup_entry_auth_failed(hass: HomeAssistant):
async def test_async_setup_entry_auth_failed(hass: HomeAssistant) -> None:
"""Test that it throws ConfigEntryAuthFailed when authentication fails."""
entry = create_entry(hass)
with patch_radarr() as radarrmock:
@ -44,7 +44,9 @@ async def test_async_setup_entry_auth_failed(hass: HomeAssistant):
assert not hass.data.get(DOMAIN)
async def test_device_info(hass: HomeAssistant, aioclient_mock: AiohttpClientMocker):
async def test_device_info(
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
) -> None:
"""Test device info."""
entry = await setup_integration(hass, aioclient_mock)
device_registry = dr.async_get(hass)