mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-28 04:44:39 +02:00
Fix xfail and skipped tests to properly pass (#1307)
This commit is contained in:
parent
8ff3babae2
commit
d95f0d4bc6
2 changed files with 28 additions and 19 deletions
|
|
@ -1296,13 +1296,17 @@ async def test_restore_off_state(hass, state):
|
|||
assert not _switch.is_on
|
||||
|
||||
|
||||
@pytest.mark.xfail(reason="Offset is larger than half a day")
|
||||
async def test_offset_too_large(hass):
|
||||
"""Test that update fails when the offset is too large."""
|
||||
"""Test that update fails when the sunrise offset is too large.
|
||||
|
||||
A 12-hour offset causes sun events to be out of order (e.g., sunrise after sunset),
|
||||
which makes the adaptive lighting algorithm fail with a ValueError.
|
||||
"""
|
||||
_, switch = await setup_switch(hass, {CONF_SUNRISE_OFFSET: 3600 * 12})
|
||||
await switch._update_attrs_and_maybe_adapt_lights(
|
||||
context=switch.create_context("test"),
|
||||
)
|
||||
with pytest.raises(ValueError, match="sun events.*not in the expected order"):
|
||||
await switch._update_attrs_and_maybe_adapt_lights(
|
||||
context=switch.create_context("test"),
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue