Remove trailing slash from base_url and added ability to generate webhook path. (#20295)

This commit is contained in:
Andrew Sayre authored and Fabian Affolter committed 2019-01-21 20:50:41 +01:00
1 parent c36c708068
commit bb21cb6c89
4 files changed
+34 -3

No files matched your search

+6
View File
@@ -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')