* Switches via API * Using external library * UT and checlist * Updating file .coveragerc * Update homeassistant/components/switchbot_via_api/switch.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/switchbot_via_api/switch.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/switchbot_via_api/switch.py Co-authored-by: J. Nick Koston <nick@koston.org> * Review fixes * Apply suggestions from code review Co-authored-by: J. Nick Koston <nick@koston.org> * This base class shouldn't know about Remote * Fixing suggestion * Sometimes, the state from the API is not updated immediately * Review changes * Some review changes * Review changes * Review change: Adding type on commands * Parameterizing some tests * Review changes * Updating .coveragerc * Fixing error handling in coordinator * Review changes * Review changes * Adding switchbot brand * Apply suggestions from code review Co-authored-by: J. Nick Koston <nick@koston.org> * Review changes * Adding strict typing * Removing log in constructor --------- Co-authored-by: J. Nick Koston <nick@koston.org>
15 lines
438 B
Python
15 lines
438 B
Python
"""Common fixtures for the SwitchBot via API tests."""
|
|
from collections.abc import Generator
|
|
from unittest.mock import AsyncMock, patch
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_setup_entry() -> Generator[AsyncMock, None, None]:
|
|
"""Override async_setup_entry."""
|
|
with patch(
|
|
"homeassistant.components.switchbot_cloud.async_setup_entry",
|
|
return_value=True,
|
|
) as mock_setup_entry:
|
|
yield mock_setup_entry
|