mirror of
https://github.com/esphome/esphome.git
synced 2025-09-17 02:32:20 +01:00
22 lines
530 B
Python
22 lines
530 B
Python
"""Common fixtures for dashboard tests."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from unittest.mock import Mock
|
|
|
|
import pytest
|
|
|
|
from esphome.dashboard.core import ESPHomeDashboard
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_dashboard() -> Mock:
|
|
"""Create a mock dashboard."""
|
|
dashboard = Mock(spec=ESPHomeDashboard)
|
|
dashboard.entries = Mock()
|
|
dashboard.entries.async_all.return_value = []
|
|
dashboard.stop_event = Mock()
|
|
dashboard.stop_event.is_set.return_value = True
|
|
dashboard.ping_request = Mock()
|
|
return dashboard
|