mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Fix description placeholder in transmission reauth (#128938)
This commit is contained in:
parent
cdfec7ebb4
commit
9cc934a972
@ -15,6 +15,7 @@ from homeassistant.config_entries import (
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONF_HOST,
|
||||
CONF_NAME,
|
||||
CONF_PASSWORD,
|
||||
CONF_PATH,
|
||||
CONF_PORT,
|
||||
@ -120,7 +121,10 @@ class TransmissionFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
return self.async_update_reload_and_abort(reauth_entry, data=user_input)
|
||||
|
||||
return self.async_show_form(
|
||||
description_placeholders={CONF_USERNAME: reauth_entry.data[CONF_USERNAME]},
|
||||
description_placeholders={
|
||||
CONF_USERNAME: reauth_entry.data[CONF_USERNAME],
|
||||
CONF_NAME: reauth_entry.title,
|
||||
},
|
||||
step_id="reauth_confirm",
|
||||
data_schema=vol.Schema(
|
||||
{
|
||||
|
@ -164,7 +164,10 @@ async def test_reauth_success(hass: HomeAssistant) -> None:
|
||||
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
assert result["step_id"] == "reauth_confirm"
|
||||
assert result["description_placeholders"] == {"username": "user"}
|
||||
assert result["description_placeholders"] == {
|
||||
"username": "user",
|
||||
"name": "Mock Title",
|
||||
}
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.transmission.async_setup_entry",
|
||||
@ -194,7 +197,10 @@ async def test_reauth_failed(hass: HomeAssistant, mock_api: MagicMock) -> None:
|
||||
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
assert result["step_id"] == "reauth_confirm"
|
||||
assert result["description_placeholders"] == {"username": "user"}
|
||||
assert result["description_placeholders"] == {
|
||||
"username": "user",
|
||||
"name": "Mock Title",
|
||||
}
|
||||
|
||||
mock_api.side_effect = TransmissionAuthError()
|
||||
result2 = await hass.config_entries.flow.async_configure(
|
||||
@ -222,7 +228,10 @@ async def test_reauth_failed_connection_error(
|
||||
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
assert result["step_id"] == "reauth_confirm"
|
||||
assert result["description_placeholders"] == {"username": "user"}
|
||||
assert result["description_placeholders"] == {
|
||||
"username": "user",
|
||||
"name": "Mock Title",
|
||||
}
|
||||
|
||||
mock_api.side_effect = TransmissionConnectError()
|
||||
result2 = await hass.config_entries.flow.async_configure(
|
||||
|
Loading…
x
Reference in New Issue
Block a user