mirror of
https://github.com/home-assistant/core.git
synced 2025-11-14 21:40:16 +00:00
27 lines
960 B
Python
27 lines
960 B
Python
"""Test Control4 Media Player."""
|
|
|
|
import pytest
|
|
from syrupy.assertion import SnapshotAssertion
|
|
|
|
from homeassistant.core import HomeAssistant
|
|
from homeassistant.helpers import entity_registry as er
|
|
|
|
from . import setup_integration
|
|
|
|
from tests.common import MockConfigEntry, snapshot_platform
|
|
|
|
|
|
@pytest.mark.usefixtures("mock_c4_account", "mock_c4_director", "mock_update_variables")
|
|
async def test_media_player_with_and_without_sources(
|
|
hass: HomeAssistant,
|
|
mock_config_entry: MockConfigEntry,
|
|
entity_registry: er.EntityRegistry,
|
|
snapshot: SnapshotAssertion,
|
|
) -> None:
|
|
"""Test that rooms with sources create entities and rooms without are skipped."""
|
|
# The default mock_c4_director fixture provides multi-room data:
|
|
# Room 1 has video source, Room 2 has no sources (thermostat-only room)
|
|
await setup_integration(hass, mock_config_entry)
|
|
|
|
await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id)
|