core/tests/components/light/conftest.py

26 lines
549 B
Python
Raw Normal View History

2020-10-23 14:28:21 +00:00
"""Light conftest."""
2021-01-01 21:31:56 +00:00
from unittest.mock import AsyncMock, patch
2020-10-23 14:28:21 +00:00
import pytest
from homeassistant.components.light import Profiles
@pytest.fixture(autouse=True)
def mock_light_profiles():
"""Mock loading of profiles."""
data = {}
def mock_profiles_class(hass):
profiles = Profiles(hass)
profiles.data = data
profiles.async_initialize = AsyncMock()
return profiles
with patch(
"homeassistant.components.light.Profiles",
side_effect=mock_profiles_class,
):
yield data