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 authored and GitHub committed 2020-05-08 17:52:32 +02:00
1 parent 1be41b9de8
commit e56dd8ed50
21 files changed
+308 -73

No files matched your search

+4 -3
View File
@@ -1,10 +1,9 @@
"""Test the webhook component."""
import pytest
from homeassistant.config import async_process_ha_core_config
from homeassistant.setup import async_setup_component
from tests.async_mock import Mock
@pytest.fixture
def mock_client(hass, hass_client):
@@ -37,7 +36,9 @@ async def test_unregistering_webhook(hass, mock_client):
async def test_generate_webhook_url(hass):
"""Test we generate a webhook url correctly."""
hass.config.api = Mock(base_url="https://example.com")
await async_process_ha_core_config(
hass, {"external_url": "https://example.com"},
)
url = hass.components.webhook.async_generate_url("some_id")
assert url == "https://example.com/api/webhook/some_id"