"""
Pytest configuration and shared fixtures.
"""
import pytest
from unittest.mock import Mock, AsyncMock
@pytest.fixture
def mock_hue_bridge():
"""Create a mock HueBridgeV2 instance for testing."""
bridge = AsyncMock()
bridge.initialize = AsyncMock()
bridge.close = AsyncMock()
# Mock lights
bridge.lights = []
bridge.devices = Mock()
bridge.groups = []
bridge.scenes = []
return bridge
@pytest.fixture
def sample_light_data():
"""Sample light data for testing."""
return {
"id": "light-123",
"name": "Test Light",
"on": True,
"brightness": 127,
"color_temp": 300,
"reachable": True,
}
@pytest.fixture
def sample_group_data():
"""Sample group data for testing."""
return {
"id": "group-456",
"name": "Test Room",
"type": "Room",
"lights": ["light-123", "light-456"],
}
@pytest.fixture
def sample_scene_data():
"""Sample scene data for testing."""
return {
"id": "scene-789",
"name": "Test Scene",
"group": "group-456",
}