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 logic
This commit is contained in:
parent
3c1e2e17a0
commit
9c82df4b98
7 changed files with 4 additions and 7 deletions
|
@ -26,7 +26,6 @@ async def test_wrong_login(
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test for setup failure if connection to Anova is missing."""
|
"""Test for setup failure if connection to Anova is missing."""
|
||||||
entry = create_entry(hass)
|
entry = create_entry(hass)
|
||||||
entry.add_to_hass(hass)
|
|
||||||
await hass.config_entries.async_setup(entry.entry_id)
|
await hass.config_entries.async_setup(entry.entry_id)
|
||||||
assert entry.state is ConfigEntryState.SETUP_ERROR
|
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])
|
await _create_august_with_devices(hass, [lock_one])
|
||||||
august_entry.add_to_hass(hass)
|
|
||||||
|
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,6 @@ async def init_integration(
|
||||||
"""Set up the Efergy integration in Home Assistant."""
|
"""Set up the Efergy integration in Home Assistant."""
|
||||||
entry = create_entry(hass, token=token)
|
entry = create_entry(hass, token=token)
|
||||||
await mock_responses(hass, aioclient_mock, token=token, error=error)
|
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.config_entries.async_setup(entry.entry_id)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
|
|
@ -571,7 +571,6 @@ async def test_scan_calendar_error(
|
||||||
config_entry,
|
config_entry,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test that the calendar update handles a server error."""
|
"""Test that the calendar update handles a server error."""
|
||||||
config_entry.add_to_hass(hass)
|
|
||||||
mock_calendars_list({}, exc=ClientError())
|
mock_calendars_list({}, exc=ClientError())
|
||||||
assert await component_setup()
|
assert await component_setup()
|
||||||
|
|
||||||
|
|
|
@ -162,7 +162,6 @@ async def test_sensors_available_after_restart(
|
||||||
manufacturer="Kraken.com",
|
manufacturer="Kraken.com",
|
||||||
entry_type=dr.DeviceEntryType.SERVICE,
|
entry_type=dr.DeviceEntryType.SERVICE,
|
||||||
)
|
)
|
||||||
entry.add_to_hass(hass)
|
|
||||||
|
|
||||||
await hass.config_entries.async_setup(entry.entry_id)
|
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={}):
|
with RuckusAjaxApiPatchContext(active_clients={}):
|
||||||
entry.add_to_hass(hass)
|
|
||||||
await hass.config_entries.async_setup(entry.entry_id)
|
await hass.config_entries.async_setup(entry.entry_id)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
|
|
@ -826,6 +826,9 @@ async def test_device_types(
|
||||||
# nightlight as a setting of the main entity
|
# nightlight as a setting of the main entity
|
||||||
if nightlight_mode_properties is not None:
|
if nightlight_mode_properties is not None:
|
||||||
mocked_bulb.last_properties["active_mode"] = True
|
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)
|
config_entry.add_to_hass(hass)
|
||||||
await _async_setup(config_entry)
|
await _async_setup(config_entry)
|
||||||
state = hass.states.get(entity_id)
|
state = hass.states.get(entity_id)
|
||||||
|
|
Loading…
Add table
Reference in a new issue