mirror of
https://github.com/home-assistant/core.git
synced 2026-07-01 03:36:05 +01:00
5e8f0d1078
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
22 lines
737 B
Python
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)
|