mirror of
https://github.com/home-assistant/core.git
synced 2025-04-27 10:47:51 +00:00

* Bump PyTado 0.19.0 * Initial setup * Current state * Update to PyTado 0.18.8 * First concept for review * Fix * Fix * Fix * First concept for review * Bump PyTado to 0.18.9 * Remove redundant part * Initial test setup * Authentication exceptions * Fix * Fix * Fix * Update version to 2 * All migration code * Small tuning * Add reauth unique ID check * Add reauth test * 100% on config flow * Making tests working on new device flow * Fix * Fix * Fix * Update homeassistant/components/tado/strings.json * Update homeassistant/components/tado/strings.json --------- Co-authored-by: Joostlek <joostlek@outlook.com> Co-authored-by: Josef Zweck <josef@zweck.dev>
31 lines
958 B
Python
31 lines
958 B
Python
"""Test the Tado integration."""
|
|
|
|
from homeassistant.components.tado import DOMAIN
|
|
from homeassistant.config_entries import ConfigEntryState
|
|
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from tests.common import MockConfigEntry
|
|
|
|
|
|
async def test_v1_migration(hass: HomeAssistant) -> None:
|
|
"""Test migration from v1 to v2 config entry."""
|
|
entry = MockConfigEntry(
|
|
domain=DOMAIN,
|
|
data={
|
|
CONF_USERNAME: "test",
|
|
CONF_PASSWORD: "test",
|
|
},
|
|
unique_id="1",
|
|
version=1,
|
|
)
|
|
entry.add_to_hass(hass)
|
|
await hass.config_entries.async_setup(entry.entry_id)
|
|
await hass.async_block_till_done()
|
|
assert entry.version == 2
|
|
assert CONF_USERNAME not in entry.data
|
|
assert CONF_PASSWORD not in entry.data
|
|
|
|
assert entry.state is ConfigEntryState.SETUP_ERROR
|
|
assert len(hass.config_entries.flow.async_progress()) == 1
|