mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 19:57:07 +00:00
Fix watttime config flow and tests (#57498)
This commit is contained in:
parent
0c04ca20c6
commit
d10b1d9fe0
@ -78,7 +78,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
async def _async_validate_credentials(
|
async def _async_validate_credentials(
|
||||||
self, username: str, password: str, error_step_id: str, error_schema: vol.Schema
|
self, username: str, password: str, error_step_id: str, error_schema: vol.Schema
|
||||||
):
|
) -> FlowResult:
|
||||||
"""Validate input credentials and proceed accordingly."""
|
"""Validate input credentials and proceed accordingly."""
|
||||||
session = aiohttp_client.async_get_clientsession(self.hass)
|
session = aiohttp_client.async_get_clientsession(self.hass)
|
||||||
|
|
||||||
|
@ -179,7 +179,6 @@ async def test_step_reauth(hass: HomeAssistant, client_login) -> None:
|
|||||||
},
|
},
|
||||||
).add_to_hass(hass)
|
).add_to_hass(hass)
|
||||||
|
|
||||||
await setup.async_setup_component(hass, "persistent_notification", {})
|
|
||||||
with patch(
|
with patch(
|
||||||
"homeassistant.components.watttime.async_setup_entry",
|
"homeassistant.components.watttime.async_setup_entry",
|
||||||
return_value=True,
|
return_value=True,
|
||||||
@ -222,7 +221,6 @@ async def test_step_reauth_invalid_credentials(hass: HomeAssistant) -> None:
|
|||||||
},
|
},
|
||||||
).add_to_hass(hass)
|
).add_to_hass(hass)
|
||||||
|
|
||||||
await setup.async_setup_component(hass, "persistent_notification", {})
|
|
||||||
with patch(
|
with patch(
|
||||||
"homeassistant.components.watttime.config_flow.Client.async_login",
|
"homeassistant.components.watttime.config_flow.Client.async_login",
|
||||||
AsyncMock(side_effect=InvalidCredentialsError),
|
AsyncMock(side_effect=InvalidCredentialsError),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user