aiohttp 2 (#6835)
* Upgrade aiohttp2 * Fix resource caching * Fix helpers.aiohttp_client * Lint * Use static path for api error_log * Fix ClientErrors import * Remove not needed DisconnectError * Remove releasing responses code * Add timeout if stream starts non responding * More async_aiohttp_proxy_stream cleanup * Fix references to ClientError * Fix fingerprinting * Fix aiohttp stream tests * Rename aiohttp_proxy_stream * Remove impossible darksky test * Fix sleepiq requests escaping mocker * Lint * Remove deprecated parameter * Break up aiohttp_proxy_stream in 2 methods * Lint * Upgrade to aiohttp 2.0.4 * Convert connector close to a callback * Fix static fingerprinted links
This commit is contained in:
1 parent
7b83a836f3
commit
714b516176
36 files changed
+250
-442
No files matched your search
@@ -1,12 +1,9 @@
|
||||
"""The tests for the Home Assistant API component."""
|
||||
# pylint: disable=protected-access
|
||||
import asyncio
|
||||
from contextlib import closing
|
||||
import json
|
||||
import unittest
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
from aiohttp import web
|
||||
import requests
|
||||
|
||||
from homeassistant import setup, const
|
||||
@@ -247,22 +244,6 @@ class TestAPI(unittest.TestCase):
|
||||
headers=HA_HEADERS)
|
||||
self.assertEqual(hass.config.components, set(req.json()))
|
||||
|
||||
def test_api_get_error_log(self):
|
||||
"""Test the return of the error log."""
|
||||
test_string = 'Test String°'
|
||||
|
||||
@asyncio.coroutine
|
||||
def mock_send():
|
||||
"""Mock file send."""
|
||||
return web.Response(text=test_string)
|
||||
|
||||
with patch('homeassistant.components.http.HomeAssistantView.file',
|
||||
Mock(return_value=mock_send())):
|
||||
req = requests.get(_url(const.URL_API_ERROR_LOG),
|
||||
headers=HA_HEADERS)
|
||||
self.assertEqual(test_string, req.text)
|
||||
self.assertIsNone(req.headers.get('expires'))
|
||||
|
||||
def test_api_get_event_listeners(self):
|
||||
"""Test if we can get the list of events being listened for."""
|
||||
req = requests.get(_url(const.URL_API_EVENTS),
|
||||
|
||||
Reference in new issue
Block a user