From 9bb7e40ee38f7f7078bb6788b28ef2eab94efa94 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 16 Jan 2019 23:23:46 +0100 Subject: [PATCH] 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 --- homeassistant/package_constraints.txt | 2 +- requirements_all.txt | 2 +- setup.py | 2 +- tests/components/camera/test_push.py | 17 +++-------------- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index eec2f7dde8c..06577be4763 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -1,4 +1,4 @@ -aiohttp==3.5.1 +aiohttp==3.5.4 astral==1.7.1 async_timeout==3.0.1 attrs==18.2.0 diff --git a/requirements_all.txt b/requirements_all.txt index fc7cf9c0e12..9595d8430e7 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1,5 +1,5 @@ # Home Assistant core -aiohttp==3.5.1 +aiohttp==3.5.4 astral==1.7.1 async_timeout==3.0.1 attrs==18.2.0 diff --git a/setup.py b/setup.py index 6fa648af781..d8c2c57b3d3 100755 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ PROJECT_URLS = { PACKAGES = find_packages(exclude=['tests', 'tests.*']) REQUIRES = [ - 'aiohttp==3.5.1', + 'aiohttp==3.5.4', 'astral==1.7.1', 'async_timeout==3.0.1', 'attrs==18.2.0', diff --git a/tests/components/camera/test_push.py b/tests/components/camera/test_push.py index be1d24ce34f..dc52965cbe0 100644 --- a/tests/components/camera/test_push.py +++ b/tests/components/camera/test_push.py @@ -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',