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:
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user