Assert the unique ID in melcloud, portainer, sma and tado config flow tests (#185252)

This commit is contained in:
Erwin Douna
2026-10-09 12:52:24 +02:00
committed by GitHub
parent 4cf739d83b
commit 330a3bd957
4 changed files with 7 additions and 7 deletions
@@ -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",
@@ -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(
+1 -1
View File
@@ -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
+3 -3
View File
@@ -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: