mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix atag test mutating config entry after its adding to hass (#107603)
This commit is contained in:
parent
9221f5da10
commit
852a73267f
@ -92,10 +92,11 @@ async def init_integration(
|
|||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
aioclient_mock: AiohttpClientMocker,
|
aioclient_mock: AiohttpClientMocker,
|
||||||
skip_setup: bool = False,
|
skip_setup: bool = False,
|
||||||
|
unique_id: str = UID,
|
||||||
) -> MockConfigEntry:
|
) -> MockConfigEntry:
|
||||||
"""Set up the Atag integration in Home Assistant."""
|
"""Set up the Atag integration in Home Assistant."""
|
||||||
mock_connection(aioclient_mock)
|
mock_connection(aioclient_mock)
|
||||||
entry = MockConfigEntry(domain=DOMAIN, data=USER_INPUT)
|
entry = MockConfigEntry(domain=DOMAIN, data=USER_INPUT, unique_id=unique_id)
|
||||||
entry.add_to_hass(hass)
|
entry.add_to_hass(hass)
|
||||||
|
|
||||||
if not skip_setup:
|
if not skip_setup:
|
||||||
|
@ -31,8 +31,7 @@ async def test_adding_second_device(
|
|||||||
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
|
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test that only one Atag configuration is allowed."""
|
"""Test that only one Atag configuration is allowed."""
|
||||||
entry = await init_integration(hass, aioclient_mock)
|
await init_integration(hass, aioclient_mock, unique_id=UID)
|
||||||
entry.unique_id = UID
|
|
||||||
|
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
DOMAIN, context={"source": config_entries.SOURCE_USER}, data=USER_INPUT
|
DOMAIN, context={"source": config_entries.SOURCE_USER}, data=USER_INPUT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user