mirror of
https://github.com/home-assistant/core.git
synced 2025-11-12 20:40:18 +00:00
Add prefix path support to pyLoad integration (#139139)
* Add prefix path configuration support * fix typo * formatting * uppercase * changes * redact host
This commit is contained in:
@@ -8,6 +8,7 @@ from pyloadapi.exceptions import CannotConnect, InvalidAuth, ParserError
|
||||
import pytest
|
||||
|
||||
from homeassistant.config_entries import SOURCE_REAUTH, ConfigEntryState
|
||||
from homeassistant.const import CONF_PATH, CONF_URL
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from tests.common import MockConfigEntry, async_fire_time_changed
|
||||
@@ -88,3 +89,22 @@ async def test_coordinator_update_invalid_auth(
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert any(config_entry.async_get_active_flows(hass, {SOURCE_REAUTH}))
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("mock_pyloadapi")
|
||||
async def test_migration(
|
||||
hass: HomeAssistant,
|
||||
config_entry_migrate: MockConfigEntry,
|
||||
) -> None:
|
||||
"""Test config entry migration."""
|
||||
|
||||
config_entry_migrate.add_to_hass(hass)
|
||||
assert config_entry_migrate.data.get(CONF_PATH) is None
|
||||
|
||||
await hass.config_entries.async_setup(config_entry_migrate.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert config_entry_migrate.state is ConfigEntryState.LOADED
|
||||
assert config_entry_migrate.version == 1
|
||||
assert config_entry_migrate.minor_version == 1
|
||||
assert config_entry_migrate.data[CONF_URL] == "https://pyload.local:8000/"
|
||||
|
||||
Reference in New Issue
Block a user