Remove trailing slash from base_url and added ability to generate webhook path. (#20295)
This commit is contained in:
1 parent
c36c708068
commit
bb21cb6c89
4 files changed
+34
-3
No files matched your search
@@ -44,6 +44,12 @@ async def test_generate_webhook_url(hass):
|
||||
assert url == 'https://example.com/api/webhook/some_id'
|
||||
|
||||
|
||||
async def test_async_generate_path(hass):
|
||||
"""Test generating just the path component of the url correctly."""
|
||||
path = hass.components.webhook.async_generate_path('some_id')
|
||||
assert path == '/api/webhook/some_id'
|
||||
|
||||
|
||||
async def test_posting_webhook_nonexisting(hass, mock_client):
|
||||
"""Test posting to a nonexisting webhook."""
|
||||
resp = await mock_client.post('/api/webhook/non-existing')
|
||||
|
||||
Reference in new issue
Block a user