mirror of
https://github.com/home-assistant/core.git
synced 2025-11-11 12:00:52 +00:00
36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
"""The sensor tests for the tado platform."""
|
|
|
|
from collections.abc import AsyncGenerator
|
|
from unittest.mock import patch
|
|
|
|
import pytest
|
|
from syrupy.assertion import SnapshotAssertion
|
|
|
|
from homeassistant.components.tado import DOMAIN
|
|
from homeassistant.const import Platform
|
|
from homeassistant.core import HomeAssistant
|
|
from homeassistant.helpers import entity_registry as er
|
|
|
|
from .util import async_init_integration
|
|
|
|
from tests.common import MockConfigEntry, snapshot_platform
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def setup_platforms() -> AsyncGenerator[None]:
|
|
"""Set up the platforms for the tests."""
|
|
with patch("homeassistant.components.tado.PLATFORMS", [Platform.SENSOR]):
|
|
yield
|
|
|
|
|
|
async def test_entities(
|
|
hass: HomeAssistant, entity_registry: er.EntityRegistry, snapshot: SnapshotAssertion
|
|
) -> None:
|
|
"""Test creation of sensor entities."""
|
|
|
|
await async_init_integration(hass)
|
|
|
|
config_entry: MockConfigEntry = hass.config_entries.async_entries(DOMAIN)[0]
|
|
|
|
await snapshot_platform(hass, entity_registry, snapshot, config_entry.entry_id)
|