Add type hints to integration tests (part 5) (#87850)

This commit is contained in:
epenet 2023-02-12 19:39:48 +01:00 committed by GitHub
parent 00c356e1ce
commit 728f62b1ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 563 additions and 332 deletions

View file

@ -16,7 +16,7 @@ def _patch_setup():
return patch("homeassistant.components.efergy.async_setup_entry")
async def test_flow_user(hass: HomeAssistant):
async def test_flow_user(hass: HomeAssistant) -> None:
"""Test user initialized flow."""
with _patch_efergy(), _patch_setup():
result = await hass.config_entries.flow.async_init(
@ -36,7 +36,7 @@ async def test_flow_user(hass: HomeAssistant):
assert result["result"].unique_id == HID
async def test_flow_user_cannot_connect(hass: HomeAssistant):
async def test_flow_user_cannot_connect(hass: HomeAssistant) -> None:
"""Test user initialized flow with unreachable service."""
with _patch_efergy_status() as efergymock:
efergymock.side_effect = exceptions.ConnectError
@ -48,7 +48,7 @@ async def test_flow_user_cannot_connect(hass: HomeAssistant):
assert result["errors"]["base"] == "cannot_connect"
async def test_flow_user_invalid_auth(hass: HomeAssistant):
async def test_flow_user_invalid_auth(hass: HomeAssistant) -> None:
"""Test user initialized flow with invalid authentication."""
with _patch_efergy_status() as efergymock:
efergymock.side_effect = exceptions.InvalidAuth
@ -60,7 +60,7 @@ async def test_flow_user_invalid_auth(hass: HomeAssistant):
assert result["errors"]["base"] == "invalid_auth"
async def test_flow_user_unknown(hass: HomeAssistant):
async def test_flow_user_unknown(hass: HomeAssistant) -> None:
"""Test user initialized flow with unknown error."""
with _patch_efergy_status() as efergymock:
efergymock.side_effect = Exception
@ -72,7 +72,7 @@ async def test_flow_user_unknown(hass: HomeAssistant):
assert result["errors"]["base"] == "unknown"
async def test_flow_reauth(hass: HomeAssistant):
async def test_flow_reauth(hass: HomeAssistant) -> None:
"""Test reauth step."""
entry = create_entry(hass)
with _patch_efergy(), _patch_setup():