mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Fix freebox pairing in bridge mode (#106131)
This commit is contained in:
committed by
GitHub
parent
d4be6632cc
commit
b9a8b992d7
@@ -69,8 +69,8 @@ async def test_zeroconf(hass: HomeAssistant) -> None:
|
||||
assert result["step_id"] == "link"
|
||||
|
||||
|
||||
async def test_link(hass: HomeAssistant, router: Mock) -> None:
|
||||
"""Test linking."""
|
||||
async def internal_test_link(hass: HomeAssistant) -> None:
|
||||
"""Test linking internal, common to both router modes."""
|
||||
with patch(
|
||||
"homeassistant.components.freebox.async_setup_entry",
|
||||
return_value=True,
|
||||
@@ -91,6 +91,30 @@ async def test_link(hass: HomeAssistant, router: Mock) -> None:
|
||||
assert len(mock_setup_entry.mock_calls) == 1
|
||||
|
||||
|
||||
async def test_link(hass: HomeAssistant, router: Mock) -> None:
|
||||
"""Test link with standard router mode."""
|
||||
await internal_test_link(hass)
|
||||
|
||||
|
||||
async def test_link_bridge_mode(hass: HomeAssistant, router_bridge_mode: Mock) -> None:
|
||||
"""Test linking for a freebox in bridge mode."""
|
||||
await internal_test_link(hass)
|
||||
|
||||
|
||||
async def test_link_bridge_mode_error(
|
||||
hass: HomeAssistant, mock_router_bridge_mode_error: Mock
|
||||
) -> None:
|
||||
"""Test linking for a freebox in bridge mode, unknown error received from API."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": SOURCE_USER},
|
||||
data={CONF_HOST: MOCK_HOST, CONF_PORT: MOCK_PORT},
|
||||
)
|
||||
result = await hass.config_entries.flow.async_configure(result["flow_id"], {})
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["errors"] == {"base": "cannot_connect"}
|
||||
|
||||
|
||||
async def test_abort_if_already_setup(hass: HomeAssistant) -> None:
|
||||
"""Test we abort if component is already setup."""
|
||||
MockConfigEntry(
|
||||
|
||||
Reference in New Issue
Block a user