Skip to content

Commit

Permalink
Fix test_changing_options_when_using_yaml (broke after #1141)
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Jan 2, 2025
1 parent 69c3e35 commit b1e3e62
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion tests/test_config_flow.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
"""Test Adaptive Lighting config flow."""

from collections.abc import Generator
from unittest.mock import AsyncMock, patch

import pytest
from homeassistant.components.adaptive_lighting.const import (
CONF_SUNRISE_TIME,
CONF_SUNSET_TIME,
Expand Down Expand Up @@ -114,10 +118,24 @@ async def test_import_twice(hass):
)


@pytest.fixture
def mock_config_entries_async_forward_entry_setup() -> Generator[AsyncMock]:
"""Mock async_forward_entry_setup."""
with patch(
"homeassistant.config_entries.ConfigEntries.async_forward_entry_setups",
) as mock_fn:
yield mock_fn


# TODO: Fix, broken for all supported versions
# But in ≤2024.5 it gives homeassistant.config_entries.UnknownEntry: cd69dbda65bd3f86e9a32d974cdfa23f
# and ≥2024.6 it times out
async def test_changing_options_when_using_yaml(hass):


async def test_changing_options_when_using_yaml(
hass,
mock_config_entries_async_forward_entry_setup,
):
"""Test changing options when using YAML."""
entry = MockConfigEntry(
domain=DOMAIN,
Expand Down

0 comments on commit b1e3e62

Please sign in to comment.