mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Fix sun test to patch time since it is now refetched (#39372)
This accounts for the fix in #39335
This commit is contained in:
parent
4682de5ac1
commit
67de1d3466
@ -120,10 +120,11 @@ async def test_state_change(hass, legacy_patchable_time):
|
|||||||
|
|
||||||
assert sun.STATE_BELOW_HORIZON == hass.states.get(sun.ENTITY_ID).state
|
assert sun.STATE_BELOW_HORIZON == hass.states.get(sun.ENTITY_ID).state
|
||||||
|
|
||||||
hass.bus.async_fire(
|
patched_time = test_time + timedelta(seconds=5)
|
||||||
ha.EVENT_TIME_CHANGED, {ha.ATTR_NOW: test_time + timedelta(seconds=5)}
|
with patch(
|
||||||
)
|
"homeassistant.helpers.condition.dt_util.utcnow", return_value=patched_time
|
||||||
|
):
|
||||||
|
hass.bus.async_fire(ha.EVENT_TIME_CHANGED, {ha.ATTR_NOW: patched_time})
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
assert sun.STATE_ABOVE_HORIZON == hass.states.get(sun.ENTITY_ID).state
|
assert sun.STATE_ABOVE_HORIZON == hass.states.get(sun.ENTITY_ID).state
|
||||||
|
Loading…
x
Reference in New Issue
Block a user