From 330a3bd957d2747cc4e7f1315d331a561ce7dfea Mon Sep 17 00:00:00 2001 From: Erwin Douna Date: Fri, 9 Oct 2026 12:52:24 +0200 Subject: [PATCH] Assert the unique ID in melcloud, portainer, sma and tado config flow tests (#185252) --- tests/components/melcloud/test_config_flow.py | 2 +- tests/components/portainer/test_config_flow.py | 4 ++-- tests/components/sma/test_config_flow.py | 2 +- tests/components/tado/test_config_flow.py | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/components/melcloud/test_config_flow.py b/tests/components/melcloud/test_config_flow.py index 1a7d8b08effb..0c6e394c1a51 100644 --- a/tests/components/melcloud/test_config_flow.py +++ b/tests/components/melcloud/test_config_flow.py @@ -64,9 +64,9 @@ async def test_form(hass: HomeAssistant, mock_login, mock_get_devices) -> None: ) 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["title"] == "test-email@test-domain.com" + assert result2["result"].unique_id == "test-email@test-domain.com" assert result2["data"] == { "username": "test-email@test-domain.com", "token": "test-token", diff --git a/tests/components/portainer/test_config_flow.py b/tests/components/portainer/test_config_flow.py index 19adb1b6de31..4c7969176066 100644 --- a/tests/components/portainer/test_config_flow.py +++ b/tests/components/portainer/test_config_flow.py @@ -16,7 +16,7 @@ from homeassistant.const import CONF_API_TOKEN, CONF_URL, CONF_VERIFY_SSL from homeassistant.core import HomeAssistant from homeassistant.data_entry_flow import FlowResultType -from .conftest import MOCK_TEST_CONFIG +from .conftest import MOCK_TEST_CONFIG, TEST_INSTANCE_ID from tests.common import MockConfigEntry @@ -49,10 +49,10 @@ async def test_form( user_input=MOCK_USER_SETUP, ) - # pylint: disable-next=home-assistant-tests-config-flow-unique-id assert result["type"] is FlowResultType.CREATE_ENTRY assert result["title"] == "https://127.0.0.1:9000/" assert result["data"] == MOCK_TEST_CONFIG + assert result["result"].unique_id == TEST_INSTANCE_ID @pytest.mark.parametrize( diff --git a/tests/components/sma/test_config_flow.py b/tests/components/sma/test_config_flow.py index 9f00d2a1b297..f0ee067c0bc4 100644 --- a/tests/components/sma/test_config_flow.py +++ b/tests/components/sma/test_config_flow.py @@ -67,10 +67,10 @@ async def test_form( ) await hass.async_block_till_done() - # pylint: disable-next=home-assistant-tests-config-flow-unique-id assert result["type"] is FlowResultType.CREATE_ENTRY assert result["title"] == MOCK_USER_INPUT["host"] assert result["data"] == MOCK_USER_INPUT + assert result["result"].unique_id == str(MOCK_DEVICE.serial) assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/tado/test_config_flow.py b/tests/components/tado/test_config_flow.py index ead27c00b23d..0ed01b6671bc 100644 --- a/tests/components/tado/test_config_flow.py +++ b/tests/components/tado/test_config_flow.py @@ -52,10 +52,10 @@ async def test_full_flow( result = await hass.config_entries.flow.async_configure(result["flow_id"]) - # pylint: disable-next=home-assistant-tests-config-flow-unique-id assert result["type"] is FlowResultType.CREATE_ENTRY assert result["title"] == "home name" assert result["data"] == {CONF_REFRESH_TOKEN: "refresh"} + assert result["result"].unique_id == "1" assert len(mock_setup_entry.mock_calls) == 1 @@ -101,10 +101,10 @@ async def test_full_flow_reauth(hass: HomeAssistant, mock_tado_api: MagicMock) - result = await hass.config_entries.flow.async_configure(result["flow_id"]) - # pylint: disable-next=home-assistant-tests-config-flow-unique-id assert result["type"] is FlowResultType.CREATE_ENTRY assert result["title"] == "home name" assert result["data"] == {CONF_REFRESH_TOKEN: "refresh"} + assert result["result"].unique_id == "1" async def test_auth_timeout( @@ -295,8 +295,8 @@ async def test_show_progress_polling( await hass.async_block_till_done() result = await hass.config_entries.flow.async_configure(result["flow_id"]) - # pylint: disable-next=home-assistant-tests-config-flow-unique-id assert result["type"] is FlowResultType.CREATE_ENTRY + assert result["result"].unique_id == "1" async def test_homekit(hass: HomeAssistant, mock_tado_api: MagicMock) -> None: