mirror of
https://github.com/home-assistant/core.git
synced 2025-11-17 23:10:28 +00:00
* Added smarla integration * Apply suggested changes * Bump pysmarlaapi version and reevaluate quality scale * Focus on switch platform * Bump pysmarlaapi version * Change default name of device * Code refactoring * Removed obsolete reload function * Code refactoring and clean up * Bump pysmarlaapi version * Refactoring and changed access token format * Fix tests for smarla config_flow * Update quality_scale * Major rework of tests and refactoring * Bump pysmarlaapi version * Use object equality operator when applicable * Refactoring * Patch both connection objects * Refactor tests * Fix leaking tests * Implemented full test coverage * Bump pysmarlaapi version * Fix tests * Improve tests --------- Co-authored-by: Joostlek <joostlek@outlook.com>
22 lines
655 B
Python
22 lines
655 B
Python
"""Test switch platform for Swing2Sleep Smarla integration."""
|
|
|
|
from unittest.mock import MagicMock
|
|
|
|
from homeassistant.config_entries import ConfigEntryState
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from . import setup_integration
|
|
|
|
from tests.common import MockConfigEntry
|
|
|
|
|
|
async def test_init_invalid_auth(
|
|
hass: HomeAssistant, mock_config_entry: MockConfigEntry, mock_connection: MagicMock
|
|
) -> None:
|
|
"""Test init invalid authentication behavior."""
|
|
mock_connection.refresh_token.return_value = False
|
|
|
|
assert not await setup_integration(hass, mock_config_entry)
|
|
|
|
assert mock_config_entry.state is ConfigEntryState.SETUP_ERROR
|