Add type hints to integration tests (part 5) (#87850)
This commit is contained in:
parent
00c356e1ce
commit
728f62b1ec
50 changed files with 563 additions and 332 deletions
|
@ -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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue