1
0
mirror of https://github.com/home-assistant/core.git synced 2026-07-01 03:36:05 +01:00
Files
core/tests/components/lyric/test_sensor.py
T
2026-06-04 10:19:49 +02:00

22 lines
737 B
Python

"""Tests for the Honeywell Lyric sensor platform."""
from datetime import datetime
from homeassistant.components.lyric.sensor import get_datetime_from_future_time
def test_get_datetime_from_future_time_none() -> None:
"""Test that None input returns None instead of raising."""
assert get_datetime_from_future_time(None) is None
def test_get_datetime_from_future_time_invalid() -> None:
"""Test that an unparsable time string returns None."""
assert get_datetime_from_future_time("not_a_time") is None
def test_get_datetime_from_future_time_valid() -> None:
"""Test that a valid time string returns a datetime."""
result = get_datetime_from_future_time("13:30:00")
assert isinstance(result, datetime)