Add type hints to integration tests (q-s) (#87706)

This commit is contained in:
epenet 2023-02-08 17:12:54 +01:00 committed by GitHub
parent 3abf7ea18a
commit ba85fdcd61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
97 changed files with 687 additions and 481 deletions

View file

@ -9,12 +9,13 @@ from pysma.exceptions import (
from homeassistant.components.sma.const import DOMAIN
from homeassistant.config_entries import SOURCE_USER
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import FlowResultType
from . import MOCK_DEVICE, MOCK_USER_INPUT, _patch_async_setup_entry
async def test_form(hass):
async def test_form(hass: HomeAssistant) -> None:
"""Test we get the form."""
result = await hass.config_entries.flow.async_init(
@ -39,7 +40,7 @@ async def test_form(hass):
assert len(mock_setup_entry.mock_calls) == 1
async def test_form_cannot_connect(hass):
async def test_form_cannot_connect(hass: HomeAssistant) -> None:
"""Test we handle cannot connect error."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER}
@ -58,7 +59,7 @@ async def test_form_cannot_connect(hass):
assert len(mock_setup_entry.mock_calls) == 0
async def test_form_invalid_auth(hass):
async def test_form_invalid_auth(hass: HomeAssistant) -> None:
"""Test we handle invalid auth error."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER}
@ -77,7 +78,7 @@ async def test_form_invalid_auth(hass):
assert len(mock_setup_entry.mock_calls) == 0
async def test_form_cannot_retrieve_device_info(hass):
async def test_form_cannot_retrieve_device_info(hass: HomeAssistant) -> None:
"""Test we handle cannot retrieve device info error."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER}
@ -96,7 +97,7 @@ async def test_form_cannot_retrieve_device_info(hass):
assert len(mock_setup_entry.mock_calls) == 0
async def test_form_unexpected_exception(hass):
async def test_form_unexpected_exception(hass: HomeAssistant) -> None:
"""Test we handle unexpected exception."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER}