Fix duplicate config entry additions in tests (#107984)
zha and plex still add the same config entry multiple times but they are going to need seperate PRs as they have more complex logicpull/108002/head
parent
3c1e2e17a0
commit
9c82df4b98
|
@ -26,7 +26,6 @@ async def test_wrong_login(
|
|||
) -> None:
|
||||
"""Test for setup failure if connection to Anova is missing."""
|
||||
entry = create_entry(hass)
|
||||
entry.add_to_hass(hass)
|
||||
await hass.config_entries.async_setup(entry.entry_id)
|
||||
assert entry.state is ConfigEntryState.SETUP_ERROR
|
||||
|
||||
|
|
|
@ -351,8 +351,7 @@ async def test_restored_state(
|
|||
],
|
||||
)
|
||||
|
||||
august_entry = await _create_august_with_devices(hass, [lock_one])
|
||||
august_entry.add_to_hass(hass)
|
||||
await _create_august_with_devices(hass, [lock_one])
|
||||
|
||||
await hass.async_block_till_done()
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ async def init_integration(
|
|||
"""Set up the Efergy integration in Home Assistant."""
|
||||
entry = create_entry(hass, token=token)
|
||||
await mock_responses(hass, aioclient_mock, token=token, error=error)
|
||||
entry.add_to_hass(hass)
|
||||
await hass.config_entries.async_setup(entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
|
|
|
@ -571,7 +571,6 @@ async def test_scan_calendar_error(
|
|||
config_entry,
|
||||
) -> None:
|
||||
"""Test that the calendar update handles a server error."""
|
||||
config_entry.add_to_hass(hass)
|
||||
mock_calendars_list({}, exc=ClientError())
|
||||
assert await component_setup()
|
||||
|
||||
|
|
|
@ -162,7 +162,6 @@ async def test_sensors_available_after_restart(
|
|||
manufacturer="Kraken.com",
|
||||
entry_type=dr.DeviceEntryType.SERVICE,
|
||||
)
|
||||
entry.add_to_hass(hass)
|
||||
|
||||
await hass.config_entries.async_setup(entry.entry_id)
|
||||
|
||||
|
|
|
@ -98,7 +98,6 @@ async def test_restoring_clients(hass: HomeAssistant) -> None:
|
|||
)
|
||||
|
||||
with RuckusAjaxApiPatchContext(active_clients={}):
|
||||
entry.add_to_hass(hass)
|
||||
await hass.config_entries.async_setup(entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
|
|
|
@ -826,6 +826,9 @@ async def test_device_types(
|
|||
# nightlight as a setting of the main entity
|
||||
if nightlight_mode_properties is not None:
|
||||
mocked_bulb.last_properties["active_mode"] = True
|
||||
config_entry = MockConfigEntry(
|
||||
domain=DOMAIN, data={**CONFIG_ENTRY_DATA, CONF_NIGHTLIGHT_SWITCH: False}
|
||||
)
|
||||
config_entry.add_to_hass(hass)
|
||||
await _async_setup(config_entry)
|
||||
state = hass.states.get(entity_id)
|
||||
|
|
Loading…
Reference in New Issue