Files
core/tests/components/tado/test_water_heater.py
2025-08-01 14:38:02 +02:00

36 lines
1.1 KiB
Python

"""The water heater 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.WATER_HEATER]):
yield
async def test_entities(
hass: HomeAssistant, entity_registry: er.EntityRegistry, snapshot: SnapshotAssertion
) -> None:
"""Test creation of water heater."""
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)