Fix atag test mutating config entry after its adding to hass (#107603)
parent
9221f5da10
commit
852a73267f
|
@ -92,10 +92,11 @@ async def init_integration(
|
|||
hass: HomeAssistant,
|
||||
aioclient_mock: AiohttpClientMocker,
|
||||
skip_setup: bool = False,
|
||||
unique_id: str = UID,
|
||||
) -> MockConfigEntry:
|
||||
"""Set up the Atag integration in Home Assistant."""
|
||||
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)
|
||||
|
||||
if not skip_setup:
|
||||
|
|
|
@ -31,8 +31,7 @@ async def test_adding_second_device(
|
|||
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
|
||||
) -> None:
|
||||
"""Test that only one Atag configuration is allowed."""
|
||||
entry = await init_integration(hass, aioclient_mock)
|
||||
entry.unique_id = UID
|
||||
await init_integration(hass, aioclient_mock, unique_id=UID)
|
||||
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": config_entries.SOURCE_USER}, data=USER_INPUT
|
||||
|
|
Loading…
Reference in New Issue