hass-core/tests/components/tessie/test_sensor.py
Brett Adams 1584f02e71
Fix time to arrival to timestamp in Tessie (#109172)
* Fix time to arrival

* Update snapshot

* Freeze time for snapshot

* Fix docstring

* Add available_fn

* Update snapshot

* Dont use variance for full charge

* Remove unrelated changes

* Revert snapshot

* Rename hours_to_datetime
2024-01-31 15:52:58 -05:00

24 lines
724 B
Python

"""Test the Tessie sensor platform."""
from freezegun.api import FrozenDateTimeFactory
from syrupy import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from .common import assert_entities, setup_platform
async def test_sensors(
hass: HomeAssistant,
snapshot: SnapshotAssertion,
entity_registry: er.EntityRegistry,
freezer: FrozenDateTimeFactory,
) -> None:
"""Tests that the sensor entities are correct."""
freezer.move_to("2024-01-01 00:00:00+00:00")
entry = await setup_platform(hass, [Platform.SENSOR])
assert_entities(hass, entry.entry_id, entity_registry, snapshot)