Add panel build type (#10589)

This commit is contained in:
Paulus Schoutsen 2017-11-14 22:39:06 -08:00 committed by GitHub
parent 1e493dcb8a
commit 7920ddda9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -49,7 +49,7 @@ NO_TIMEOUT = {
}
NO_AUTH = {
re.compile(r'^panel$'), re.compile(r'^addons/[^/]*/logo$')
re.compile(r'^panel_(es5|latest)$'), re.compile(r'^addons/[^/]*/logo$')
}
SCHEMA_ADDON = vol.Schema({

View file

@ -231,7 +231,8 @@ def test_auth_required_forward_request(hassio_client):
@asyncio.coroutine
def test_forward_request_no_auth_for_panel(hassio_client):
@pytest.mark.parametrize('build_type', ['es5', 'latest'])
def test_forward_request_no_auth_for_panel(hassio_client, build_type):
"""Test no auth needed for ."""
response = MagicMock()
response.read.return_value = mock_coro('data')
@ -240,7 +241,8 @@ def test_forward_request_no_auth_for_panel(hassio_client):
Mock(return_value=mock_coro(response))), \
patch('homeassistant.components.hassio._create_response') as mresp:
mresp.return_value = 'response'
resp = yield from hassio_client.get('/api/hassio/panel')
resp = yield from hassio_client.get(
'/api/hassio/panel_{}'.format(build_type))
# Check we got right response
assert resp.status == 200