1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Add Hass.io user headers to supervisor proxy

This commit is contained in:
Paulus Schoutsen
2018-12-17 11:27:03 +01:00
parent 3f65a03024
commit fd21d6cc9d
5 changed files with 46 additions and 6 deletions

View File

@@ -27,7 +27,7 @@ def hassio_env():
@pytest.fixture
def hassio_client(hassio_env, hass, aiohttp_client, legacy_auth):
def hassio_stubs(hassio_env, hass, hass_client, aioclient_mock):
"""Create mock hassio http client."""
with patch('homeassistant.components.hassio.HassIO.update_hass_api',
Mock(return_value=mock_coro({"result": "ok"}))), \
@@ -40,6 +40,15 @@ def hassio_client(hassio_env, hass, aiohttp_client, legacy_auth):
'api_password': API_PASSWORD
}
}))
@pytest.fixture
def hassio_client(hassio_stubs, hass, hass_client):
yield hass.loop.run_until_complete(hass_client())
@pytest.fixture
def hassio_noauth_client(hassio_stubs, hass, aiohttp_client):
yield hass.loop.run_until_complete(aiohttp_client(hass.http.app))