No more opt-out auth (#18854)

* No more opt-out auth

* Fix var
This commit is contained in:
Paulus Schoutsen authored and Pascal Vizeli committed 2018-12-02 16:32:53 +01:00
1 parent ae9e3d83d7
commit d1a621601d
42 files changed
+307 -473

No files matched your search

+10 -10
View File
@@ -7,7 +7,7 @@ from homeassistant.setup import async_setup_component
@asyncio.coroutine
def test_fetching_url(aioclient_mock, hass, aiohttp_client):
def test_fetching_url(aioclient_mock, hass, hass_client):
"""Test that it fetches the given url."""
aioclient_mock.get('http://example.com', text='hello world')
@@ -20,7 +20,7 @@ def test_fetching_url(aioclient_mock, hass, aiohttp_client):
'password': 'pass'
}})
client = yield from aiohttp_client(hass.http.app)
client = yield from hass_client()
resp = yield from client.get('/api/camera_proxy/camera.config_test')
@@ -34,7 +34,7 @@ def test_fetching_url(aioclient_mock, hass, aiohttp_client):
@asyncio.coroutine
def test_fetching_without_verify_ssl(aioclient_mock, hass, aiohttp_client):
def test_fetching_without_verify_ssl(aioclient_mock, hass, hass_client):
"""Test that it fetches the given url when ssl verify is off."""
aioclient_mock.get('https://example.com', text='hello world')
@@ -48,7 +48,7 @@ def test_fetching_without_verify_ssl(aioclient_mock, hass, aiohttp_client):
'verify_ssl': 'false',
}})
client = yield from aiohttp_client(hass.http.app)
client = yield from hass_client()
resp = yield from client.get('/api/camera_proxy/camera.config_test')
@@ -56,7 +56,7 @@ def test_fetching_without_verify_ssl(aioclient_mock, hass, aiohttp_client):
@asyncio.coroutine
def test_fetching_url_with_verify_ssl(aioclient_mock, hass, aiohttp_client):
def test_fetching_url_with_verify_ssl(aioclient_mock, hass, hass_client):
"""Test that it fetches the given url when ssl verify is explicitly on."""
aioclient_mock.get('https://example.com', text='hello world')
@@ -70,7 +70,7 @@ def test_fetching_url_with_verify_ssl(aioclient_mock, hass, aiohttp_client):
'verify_ssl': 'true',
}})
client = yield from aiohttp_client(hass.http.app)
client = yield from hass_client()
resp = yield from client.get('/api/camera_proxy/camera.config_test')
@@ -78,7 +78,7 @@ def test_fetching_url_with_verify_ssl(aioclient_mock, hass, aiohttp_client):
@asyncio.coroutine
def test_limit_refetch(aioclient_mock, hass, aiohttp_client):
def test_limit_refetch(aioclient_mock, hass, hass_client):
"""Test that it fetches the given url."""
aioclient_mock.get('http://example.com/5a', text='hello world')
aioclient_mock.get('http://example.com/10a', text='hello world')
@@ -94,7 +94,7 @@ def test_limit_refetch(aioclient_mock, hass, aiohttp_client):
'limit_refetch_to_url_change': True,
}})
client = yield from aiohttp_client(hass.http.app)
client = yield from hass_client()
resp = yield from client.get('/api/camera_proxy/camera.config_test')
@@ -139,7 +139,7 @@ def test_limit_refetch(aioclient_mock, hass, aiohttp_client):
@asyncio.coroutine
def test_camera_content_type(aioclient_mock, hass, aiohttp_client):
def test_camera_content_type(aioclient_mock, hass, hass_client):
"""Test generic camera with custom content_type."""
svg_image = '<some image>'
urlsvg = 'https://upload.wikimedia.org/wikipedia/commons/0/02/SVG_logo.svg'
@@ -158,7 +158,7 @@ def test_camera_content_type(aioclient_mock, hass, aiohttp_client):
yield from async_setup_component(hass, 'camera', {
'camera': [cam_config_svg, cam_config_normal]})
client = yield from aiohttp_client(hass.http.app)
client = yield from hass_client()
resp_1 = yield from client.get('/api/camera_proxy/camera.config_test_svg')
assert aioclient_mock.call_count == 1
+4 -4
View File
@@ -11,7 +11,7 @@ from tests.common import mock_registry
@asyncio.coroutine
def test_loading_file(hass, aiohttp_client):
def test_loading_file(hass, hass_client):
"""Test that it loads image from disk."""
mock_registry(hass)
@@ -24,7 +24,7 @@ def test_loading_file(hass, aiohttp_client):
'file_path': 'mock.file',
}})
client = yield from aiohttp_client(hass.http.app)
client = yield from hass_client()
m_open = mock.mock_open(read_data=b'hello')
with mock.patch(
@@ -56,7 +56,7 @@ def test_file_not_readable(hass, caplog):
@asyncio.coroutine
def test_camera_content_type(hass, aiohttp_client):
def test_camera_content_type(hass, hass_client):
"""Test local_file camera content_type."""
cam_config_jpg = {
'name': 'test_jpg',
@@ -83,7 +83,7 @@ def test_camera_content_type(hass, aiohttp_client):
'camera': [cam_config_jpg, cam_config_png,
cam_config_svg, cam_config_noext]})
client = yield from aiohttp_client(hass.http.app)
client = yield from hass_client()
image = 'hello'
m_open = mock.mock_open(read_data=image.encode())