Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Remove obsolete entity count safeguards when using snapshot_platform test helper" #128477

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/components/axis/test_binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
3 changes: 3 additions & 0 deletions tests/components/fritz/test_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

mib1185 marked this conversation as resolved.
Show resolved Hide resolved
await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id)


Expand Down
3 changes: 3 additions & 0 deletions tests/components/fritz/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
9 changes: 9 additions & 0 deletions tests/components/fritz/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand All @@ -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)


Expand Down Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions tests/components/israel_rail/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
3 changes: 3 additions & 0 deletions tests/components/nextcloud/test_binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
3 changes: 3 additions & 0 deletions tests/components/nextcloud/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
3 changes: 3 additions & 0 deletions tests/components/nextcloud/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down