Upgrade aiohttp to 3.5.3 (#19957)
* Upgrade aiohttp to 3.5.3 * Upgrade aiohttp to 3.5.4 * Remove test for webhook component from camera.push * Lint
This commit is contained in:
1 parent
368682647d
commit
9bb7e40ee3
4 files changed
+6
-17
No files matched your search
@@ -4,14 +4,12 @@ import io
|
||||
from datetime import timedelta
|
||||
|
||||
from homeassistant import core as ha
|
||||
from homeassistant.components import webhook
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.util import dt as dt_util
|
||||
|
||||
|
||||
async def test_bad_posting(aioclient_mock, hass, aiohttp_client):
|
||||
async def test_bad_posting(hass, aiohttp_client):
|
||||
"""Test that posting to wrong api endpoint fails."""
|
||||
await async_setup_component(hass, webhook.DOMAIN, {})
|
||||
await async_setup_component(hass, 'camera', {
|
||||
'camera': {
|
||||
'platform': 'push',
|
||||
@@ -23,17 +21,9 @@ async def test_bad_posting(aioclient_mock, hass, aiohttp_client):
|
||||
|
||||
client = await aiohttp_client(hass.http.app)
|
||||
|
||||
# wrong webhook
|
||||
files = {'image': io.BytesIO(b'fake')}
|
||||
resp = await client.post('/api/webhood/camera.wrong', data=files)
|
||||
assert resp.status == 404
|
||||
|
||||
# missing file
|
||||
camera_state = hass.states.get('camera.config_test')
|
||||
assert camera_state.state == 'idle'
|
||||
|
||||
resp = await client.post('/api/webhook/camera.config_test')
|
||||
assert resp.status == 200 # webhooks always return 200
|
||||
async with client.post('/api/webhook/camera.config_test') as resp:
|
||||
assert resp.status == 200 # webhooks always return 200
|
||||
|
||||
camera_state = hass.states.get('camera.config_test')
|
||||
assert camera_state.state == 'idle' # no file supplied we are still idle
|
||||
@@ -41,7 +31,6 @@ async def test_bad_posting(aioclient_mock, hass, aiohttp_client):
|
||||
|
||||
async def test_posting_url(hass, aiohttp_client):
|
||||
"""Test that posting to api endpoint works."""
|
||||
await async_setup_component(hass, webhook.DOMAIN, {})
|
||||
await async_setup_component(hass, 'camera', {
|
||||
'camera': {
|
||||
'platform': 'push',
|
||||
|
||||
Reference in new issue
Block a user