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

Fix cloudhooks coming in for non existing webhooks (#36836)

* Fix cloudhooks coming in for non existing webhooks

* Fix tests"
This commit is contained in:
Paulus Schoutsen
2020-06-15 16:30:40 -07:00
committed by GitHub
parent 02f174e2e6
commit 3ee3ae7633
6 changed files with 76 additions and 10 deletions

View File

@@ -5,14 +5,14 @@ from homeassistant.util import aiohttp
async def test_request_json():
"""Test a JSON request."""
request = aiohttp.MockRequest(b'{"hello": 2}')
request = aiohttp.MockRequest(b'{"hello": 2}', mock_source="test")
assert request.status == 200
assert await request.json() == {"hello": 2}
async def test_request_text():
"""Test a JSON request."""
request = aiohttp.MockRequest(b"hello", status=201)
request = aiohttp.MockRequest(b"hello", status=201, mock_source="test")
assert request.status == 201
assert await request.text() == "hello"
@@ -20,7 +20,7 @@ async def test_request_text():
async def test_request_post_query():
"""Test a JSON request."""
request = aiohttp.MockRequest(
b"hello=2&post=true", query_string="get=true", method="POST"
b"hello=2&post=true", query_string="get=true", method="POST", mock_source="test"
)
assert request.method == "POST"
assert await request.post() == {"hello": "2", "post": "true"}