Fix cloudhooks coming in for non existing webhooks (#36836)
* Fix cloudhooks coming in for non existing webhooks * Fix tests"
This commit is contained in:
1 parent
02f174e2e6
commit
3ee3ae7633
6 files changed
+76
-10
No files matched your search
@@ -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