mirror of
https://github.com/home-assistant/core.git
synced 2026-12-03 04:08:19 -04:00
Bump Renault to platinum quality scale (#187500)
This commit is contained in:
@@ -8,6 +8,6 @@
|
||||
"integration_type": "hub",
|
||||
"iot_class": "cloud_polling",
|
||||
"loggers": ["renault_api"],
|
||||
"quality_scale": "silver",
|
||||
"quality_scale": "platinum",
|
||||
"requirements": ["renault-api==0.6.1"]
|
||||
}
|
||||
|
||||
@@ -393,17 +393,47 @@ async def test_reauth(hass: HomeAssistant, config_entry: MockConfigEntry) -> Non
|
||||
assert config_entry.data[RenaultConfigurationKeys.LOGIN_TOKEN] == MOCK_LOGIN_TOKEN
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("exception", "error"),
|
||||
[
|
||||
(Exception(), "unknown"),
|
||||
(aiohttp.ClientConnectionError(), "cannot_connect"),
|
||||
(
|
||||
InvalidCredentialsException(403042, "invalid loginID or password"),
|
||||
"invalid_credentials",
|
||||
),
|
||||
],
|
||||
)
|
||||
async def test_reconfigure(
|
||||
hass: HomeAssistant,
|
||||
mock_setup_entry: AsyncMock,
|
||||
config_entry: MockConfigEntry,
|
||||
exception: Exception,
|
||||
error: str,
|
||||
) -> None:
|
||||
"""Test reconfigure works."""
|
||||
"""Test reconfigure works, after recovering from a login error."""
|
||||
result = await config_entry.start_reconfigure_flow(hass)
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
assert result["step_id"] == "user"
|
||||
assert not result["errors"]
|
||||
|
||||
with patch(
|
||||
"renault_api.renault_session.RenaultSession.login",
|
||||
side_effect=exception,
|
||||
):
|
||||
result = await hass.config_entries.flow.async_configure(
|
||||
result["flow_id"],
|
||||
user_input={
|
||||
RenaultConfigurationKeys.LOCALE: "fr_FR",
|
||||
RenaultConfigurationKeys.USERNAME: "email@test.com",
|
||||
RenaultConfigurationKeys.PASSWORD: "test",
|
||||
},
|
||||
)
|
||||
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
assert result["step_id"] == "user"
|
||||
assert result["errors"] == {"base": error}
|
||||
|
||||
data_schema = result["data_schema"].schema
|
||||
assert (
|
||||
get_schema_suggested_value(data_schema, RenaultConfigurationKeys.LOCALE)
|
||||
|
||||
Reference in New Issue
Block a user