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:
parent
1be41b9de8
commit
e56dd8ed50
21 changed files with 308 additions and 73 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue