mirror of
https://github.com/home-assistant/core.git
synced 2026-12-03 04:08:19 -04:00
Add test for Palazzetti DHCP discovery of already configured device (#192666)
This commit is contained in:
@@ -140,3 +140,24 @@ async def test_dhcp_flow_error(
|
||||
|
||||
assert result["type"] is FlowResultType.ABORT
|
||||
assert result["reason"] == "cannot_connect"
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("mock_setup_entry")
|
||||
async def test_dhcp_already_configured(
|
||||
hass: HomeAssistant,
|
||||
mock_palazzetti_client: AsyncMock,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
) -> None:
|
||||
"""Test DHCP discovery aborts when device is already configured."""
|
||||
mock_config_entry.add_to_hass(hass)
|
||||
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
data=DhcpServiceInfo(
|
||||
hostname="connbox1234", ip="192.168.1.1", macaddress="112233445566"
|
||||
),
|
||||
context={"source": SOURCE_DHCP},
|
||||
)
|
||||
|
||||
assert result["type"] is FlowResultType.ABORT
|
||||
assert result["reason"] == "already_configured"
|
||||
|
||||
Reference in New Issue
Block a user