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

@ -2,11 +2,18 @@
from regenmaschine.errors import RainMachineError
from homeassistant.components.diagnostics import REDACTED
from homeassistant.core import HomeAssistant
from tests.components.diagnostics import get_diagnostics_for_config_entry
from tests.typing import ClientSessionGenerator
async def test_entry_diagnostics(hass, config_entry, hass_client, setup_rainmachine):
async def test_entry_diagnostics(
hass: HomeAssistant,
config_entry,
hass_client: ClientSessionGenerator,
setup_rainmachine,
) -> None:
"""Test config entry diagnostics."""
assert await get_diagnostics_for_config_entry(hass, hass_client, config_entry) == {
"entry": {
@ -626,8 +633,12 @@ async def test_entry_diagnostics(hass, config_entry, hass_client, setup_rainmach
async def test_entry_diagnostics_failed_controller_diagnostics(
hass, config_entry, controller, hass_client, setup_rainmachine
):
hass: HomeAssistant,
config_entry,
controller,
hass_client: ClientSessionGenerator,
setup_rainmachine,
) -> None:
"""Test config entry diagnostics when the controller diagnostics API call fails."""
controller.diagnostics.current.side_effect = RainMachineError
assert await get_diagnostics_for_config_entry(hass, hass_client, config_entry) == {