Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Michael
f4bcbbabf5
Revert "Remove obsolete entity count safeguards when using `snapshot_platform…"
This reverts commit 808d93d767.
2024-10-15 21:17:21 +02:00
8 changed files with 26 additions and 0 deletions

View file

@ -119,6 +119,7 @@ async def test_binary_sensors(
with patch("homeassistant.components.axis.PLATFORMS", [Platform.BINARY_SENSOR]):
config_entry = await config_entry_factory()
mock_rtsp_event(**event)
assert len(hass.states.async_entity_ids(BINARY_SENSOR_DOMAIN)) == 1
await snapshot_platform(hass, entity_registry, snapshot, config_entry.entry_id)

View file

@ -42,6 +42,9 @@ async def test_button_setup(
assert await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
states = hass.states.async_all()
assert len(states) == 5
await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id)

View file

@ -39,6 +39,9 @@ async def test_sensor_setup(
assert await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
states = hass.states.async_all()
assert len(states) == 16
await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id)

View file

@ -46,6 +46,9 @@ async def test_update_entities_initialized(
assert await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
states = hass.states.async_all()
assert len(states) == 1
await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id)
@ -68,6 +71,9 @@ async def test_update_available(
assert await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
states = hass.states.async_all()
assert len(states) == 1
await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id)
@ -96,6 +102,9 @@ async def test_available_update_can_be_installed(
assert await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
states = hass.states.async_all()
assert len(states) == 1
await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id)
await hass.services.async_call(

View file

@ -26,6 +26,7 @@ async def test_valid_config(
) -> None:
"""Ensure everything starts correctly."""
await init_integration(hass, mock_config_entry)
assert len(hass.states.async_entity_ids()) == 6
await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id)

View file

@ -27,4 +27,7 @@ async def test_async_setup_entry(
):
entry = await init_integration(hass, VALID_CONFIG, NC_DATA)
states = hass.states.async_all()
assert len(states) == 6
await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id)

View file

@ -25,4 +25,7 @@ async def test_async_setup_entry(
with patch("homeassistant.components.nextcloud.PLATFORMS", [Platform.SENSOR]):
entry = await init_integration(hass, VALID_CONFIG, NC_DATA)
states = hass.states.async_all()
assert len(states) == 80
await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id)

View file

@ -26,6 +26,9 @@ async def test_async_setup_entry(
with patch("homeassistant.components.nextcloud.PLATFORMS", [Platform.UPDATE]):
entry = await init_integration(hass, VALID_CONFIG, NC_DATA)
states = hass.states.async_all()
assert len(states) == 1
await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id)