Fix atag test mutating config entry after its adding to hass (#107603)

pull/107590/head
J. Nick Koston 2024-01-13 09:34:49 -10:00 committed by GitHub
parent 9221f5da10
commit 852a73267f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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:

View File

@ -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