2023-09-16 23:00:41 +09:00
|
|
|
"""Common fixtures for the SwitchBot via API tests."""
|
2024-03-08 14:47:22 +01:00
|
|
|
|
2023-09-16 23:00:41 +09:00
|
|
|
from unittest.mock import AsyncMock, patch
|
|
|
|
|
|
|
|
|
|
import pytest
|
2024-06-06 17:41:37 +02:00
|
|
|
from typing_extensions import Generator
|
2023-09-16 23:00:41 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
2024-06-06 17:41:37 +02:00
|
|
|
def mock_setup_entry() -> Generator[AsyncMock]:
|
2023-09-16 23:00:41 +09:00
|
|
|
"""Override async_setup_entry."""
|
|
|
|
|
with patch(
|
|
|
|
|
"homeassistant.components.switchbot_cloud.async_setup_entry",
|
|
|
|
|
return_value=True,
|
|
|
|
|
) as mock_setup_entry:
|
|
|
|
|
yield mock_setup_entry
|