1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Detect use of deprecated base_url (#35353)

* Detect use of deprecated base_url

* Update get_url helper

* Update core migration

* Migrate all tests
This commit is contained in:
Franck Nijhof
2020-05-08 17:52:32 +02:00
committed by GitHub
parent 1be41b9de8
commit e56dd8ed50
21 changed files with 308 additions and 73 deletions

View File

@@ -1310,12 +1310,12 @@ async def test_migration_base_url(hass, hass_storage):
assert mock_listen.mock_calls[0][1][0] == EVENT_HOMEASSISTANT_START
# External
hass.config.api = Mock(base_url="https://loaded-example.com")
hass.config.api = Mock(deprecated_base_url="https://loaded-example.com")
await mock_listen.mock_calls[0][1][1](None)
assert config.external_url == "https://loaded-example.com"
# Internal
for internal in ("http://hass.local", "http://192.168.1.100:8123"):
hass.config.api = Mock(base_url=internal)
hass.config.api = Mock(deprecated_base_url=internal)
await mock_listen.mock_calls[0][1][1](None)
assert config.internal_url == internal