This commit is contained in:
Paulus Schoutsen committed 2019-07-31 12:25:30 -07:00
1 parent da05dfe708
commit 4de97abc3a
2676 files changed
+163166 -140084

No files matched your search

+20 -18
View File
@@ -5,30 +5,32 @@ from homeassistant.setup import async_setup_component
from tests.common import ensure_auth_manager_loaded
BASE_CONFIG = [{
'name': 'Example',
'type': 'insecure_example',
'users': [{
'username': 'test-user',
'password': 'test-pass',
'name': 'Test Name'
}]
}]
BASE_CONFIG = [
{
"name": "Example",
"type": "insecure_example",
"users": [
{"username": "test-user", "password": "test-pass", "name": "Test Name"}
],
}
]
EMPTY_CONFIG = []
async def async_setup_auth(hass, aiohttp_client, provider_configs=BASE_CONFIG,
module_configs=EMPTY_CONFIG, setup_api=False):
async def async_setup_auth(
hass,
aiohttp_client,
provider_configs=BASE_CONFIG,
module_configs=EMPTY_CONFIG,
setup_api=False,
):
"""Set up authentication and create an HTTP client."""
hass.auth = await auth.auth_manager_from_config(
hass, provider_configs, module_configs)
hass, provider_configs, module_configs
)
ensure_auth_manager_loaded(hass.auth)
await async_setup_component(hass, 'auth', {
'http': {
'api_password': 'bla'
}
})
await async_setup_component(hass, "auth", {"http": {"api_password": "bla"}})
if setup_api:
await async_setup_component(hass, 'api', {})
await async_setup_component(hass, "api", {})
return await aiohttp_client(hass.http.app)