mirror of
https://github.com/home-assistant/core.git
synced 2025-07-31 03:08:01 +02:00
Improve coverage of input_datetime/reproduce_state (#28272)
* Improve coverage of input_datetime/reproduce_state * Improve tests
This commit is contained in:
committed by
Paulus Schoutsen
parent
fbe3d8dade
commit
0996b717ce
@ -36,10 +36,19 @@ async def test_reproducing_states(hass, caplog):
|
||||
|
||||
# Test invalid state is handled
|
||||
await hass.helpers.state.async_reproduce_state(
|
||||
[State("input_datetime.entity_datetime", "not_supported")], blocking=True
|
||||
[
|
||||
State("input_datetime.entity_datetime", "not_supported"),
|
||||
State("input_datetime.entity_datetime", "not-valid-date"),
|
||||
State("input_datetime.entity_datetime", "not:valid:time"),
|
||||
State("input_datetime.entity_datetime", "1234-56-78 90:12:34"),
|
||||
],
|
||||
blocking=True,
|
||||
)
|
||||
|
||||
assert "not_supported" in caplog.text
|
||||
assert "not-valid-date" in caplog.text
|
||||
assert "not:valid:time" in caplog.text
|
||||
assert "1234-56-78 90:12:34" in caplog.text
|
||||
assert len(datetime_calls) == 0
|
||||
|
||||
# Make sure correct services are called
|
||||
|
Reference in New Issue
Block a user