Assert the unique ID in flux_led config flow tests (#185305)

This commit is contained in:
Erwin Douna
2026-10-09 12:05:01 +02:00
committed by GitHub
parent d30c1ac7b4
commit cfb7bee164
@@ -90,7 +90,6 @@ async def test_discovery(hass: HomeAssistant) -> None:
)
await hass.async_block_till_done()
# pylint: disable-next=home-assistant-tests-config-flow-unique-id
assert result3["type"] is FlowResultType.CREATE_ENTRY
assert result3["title"] == DEFAULT_ENTRY_TITLE
assert result3["data"] == {
@@ -104,6 +103,7 @@ async def test_discovery(hass: HomeAssistant) -> None:
CONF_REMOTE_ACCESS_HOST: "the.cloud",
CONF_REMOTE_ACCESS_PORT: 8816,
}
assert result3["result"].unique_id == MAC_ADDRESS
mock_setup.assert_called_once()
mock_setup_entry.assert_called_once()
@@ -166,7 +166,6 @@ async def test_discovery_legacy(hass: HomeAssistant) -> None:
)
await hass.async_block_till_done()
# pylint: disable-next=home-assistant-tests-config-flow-unique-id
assert result3["type"] is FlowResultType.CREATE_ENTRY
assert result3["title"] == DEFAULT_ENTRY_TITLE
assert result3["data"] == {
@@ -180,6 +179,7 @@ async def test_discovery_legacy(hass: HomeAssistant) -> None:
CONF_REMOTE_ACCESS_HOST: "the.cloud",
CONF_REMOTE_ACCESS_PORT: 8816,
}
assert result3["result"].unique_id == MAC_ADDRESS
mock_setup.assert_called_once()
mock_setup_entry.assert_called_once()
@@ -250,7 +250,6 @@ async def test_discovery_with_existing_device_present(hass: HomeAssistant) -> No
result3 = await hass.config_entries.flow.async_configure(
result["flow_id"], {CONF_DEVICE: MAC_ADDRESS}
)
# pylint: disable-next=home-assistant-tests-config-flow-unique-id
assert result3["type"] is FlowResultType.CREATE_ENTRY
assert result3["title"] == DEFAULT_ENTRY_TITLE
assert result3["data"] == {
@@ -264,6 +263,7 @@ async def test_discovery_with_existing_device_present(hass: HomeAssistant) -> No
CONF_REMOTE_ACCESS_HOST: "the.cloud",
CONF_REMOTE_ACCESS_PORT: 8816,
}
assert result3["result"].unique_id == MAC_ADDRESS
await hass.async_block_till_done()
mock_setup_entry.assert_called_once()
@@ -520,7 +520,6 @@ async def test_discovered_by_discovery(hass: HomeAssistant) -> None:
result2 = await hass.config_entries.flow.async_configure(result["flow_id"], {})
await hass.async_block_till_done()
# pylint: disable-next=home-assistant-tests-config-flow-unique-id
assert result2["type"] is FlowResultType.CREATE_ENTRY
assert result2["data"] == {
CONF_MINOR_VERSION: 4,
@@ -533,6 +532,7 @@ async def test_discovered_by_discovery(hass: HomeAssistant) -> None:
CONF_REMOTE_ACCESS_HOST: "the.cloud",
CONF_REMOTE_ACCESS_PORT: 8816,
}
assert result2["result"].unique_id == MAC_ADDRESS
assert mock_async_setup.called
assert mock_async_setup_entry.called
@@ -560,7 +560,6 @@ async def test_discovered_by_dhcp_udp_responds(hass: HomeAssistant) -> None:
result2 = await hass.config_entries.flow.async_configure(result["flow_id"], {})
await hass.async_block_till_done()
# pylint: disable-next=home-assistant-tests-config-flow-unique-id
assert result2["type"] is FlowResultType.CREATE_ENTRY
assert result2["data"] == {
CONF_MINOR_VERSION: 4,
@@ -573,6 +572,7 @@ async def test_discovered_by_dhcp_udp_responds(hass: HomeAssistant) -> None:
CONF_REMOTE_ACCESS_HOST: "the.cloud",
CONF_REMOTE_ACCESS_PORT: 8816,
}
assert result2["result"].unique_id == MAC_ADDRESS
assert mock_async_setup.called
assert mock_async_setup_entry.called
@@ -600,13 +600,13 @@ async def test_discovered_by_dhcp_no_udp_response(hass: HomeAssistant) -> None:
result2 = await hass.config_entries.flow.async_configure(result["flow_id"], {})
await hass.async_block_till_done()
# pylint: disable-next=home-assistant-tests-config-flow-unique-id
assert result2["type"] is FlowResultType.CREATE_ENTRY
assert result2["data"] == {
CONF_HOST: IP_ADDRESS,
CONF_MODEL_NUM: MODEL_NUM,
CONF_MODEL_DESCRIPTION: MODEL_DESCRIPTION,
}
assert result2["result"].unique_id == MAC_ADDRESS
assert mock_async_setup.called
assert mock_async_setup_entry.called
@@ -636,7 +636,6 @@ async def test_discovered_by_dhcp_partial_udp_response_fallback_tcp(
result2 = await hass.config_entries.flow.async_configure(result["flow_id"], {})
await hass.async_block_till_done()
# pylint: disable-next=home-assistant-tests-config-flow-unique-id
assert result2["type"] is FlowResultType.CREATE_ENTRY
assert result2["data"] == {
CONF_HOST: IP_ADDRESS,
@@ -644,6 +643,7 @@ async def test_discovered_by_dhcp_partial_udp_response_fallback_tcp(
CONF_MODEL_DESCRIPTION: MODEL_DESCRIPTION,
}
assert result2["title"] == "Bulb RGBCW DDEEFF"
assert result2["result"].unique_id == MAC_ADDRESS
assert mock_async_setup.called
assert mock_async_setup_entry.called