mirror of
https://github.com/home-assistant/core.git
synced 2025-04-29 19:57:52 +00:00

* update total_connect_client to 2021.10 * update for total_connect_client changes * remove unused return value * bump total_connect_client to 2021.11.1 * bump total_connect_client to 2021.11.2 * Move to public ResultCode * load locations to prevent 'unknown error occurred' * add test for zero locations * Revert "load locations to prevent 'unknown error occurred'" This reverts commit 28b8984be5b1c8839fc8077d8d59bdba97eacc38. * Revert "add test for zero locations" This reverts commit 77bf7908d508d539d6165fc986930b041b13ca97.
30 lines
918 B
Python
30 lines
918 B
Python
"""Tests for the TotalConnect init process."""
|
|
from unittest.mock import patch
|
|
|
|
from homeassistant.components.totalconnect.const import DOMAIN
|
|
from homeassistant.config_entries import ConfigEntryState
|
|
from homeassistant.setup import async_setup_component
|
|
|
|
from .common import CONFIG_DATA
|
|
|
|
from tests.common import MockConfigEntry
|
|
|
|
|
|
async def test_reauth_started(hass):
|
|
"""Test that reauth is started when we have login errors."""
|
|
mock_entry = MockConfigEntry(
|
|
domain=DOMAIN,
|
|
data=CONFIG_DATA,
|
|
)
|
|
mock_entry.add_to_hass(hass)
|
|
|
|
with patch(
|
|
"homeassistant.components.totalconnect.TotalConnectClient",
|
|
autospec=True,
|
|
) as mock_client:
|
|
mock_client.return_value.is_logged_in.return_value = False
|
|
assert await async_setup_component(hass, DOMAIN, {})
|
|
await hass.async_block_till_done()
|
|
|
|
assert mock_entry.state is ConfigEntryState.SETUP_ERROR
|