Split bootstrap into bs + setup (#6416)

* Split bootstrap into bs + setup

* Lint
This commit is contained in:
Paulus Schoutsen authored and Pascal Vizeli committed 2017-03-05 10:41:54 +01:00
1 parent bdf948d866
commit 2650c73a89
171 files changed
+972 -959

No files matched your search

+3 -3
View File
@@ -6,7 +6,7 @@ from unittest.mock import patch
import requests
from homeassistant import bootstrap, const
from homeassistant import setup, const
import homeassistant.components.http as http
from homeassistant.components.http.const import (
KEY_TRUSTED_NETWORKS, KEY_USE_X_FORWARDED_FOR, HTTP_HEADER_X_FORWARDED_FOR)
@@ -43,7 +43,7 @@ def setUpModule():
hass = get_test_home_assistant()
bootstrap.setup_component(
setup.setup_component(
hass, http.DOMAIN, {
http.DOMAIN: {
http.CONF_API_PASSWORD: API_PASSWORD,
@@ -52,7 +52,7 @@ def setUpModule():
}
)
bootstrap.setup_component(hass, 'api')
setup.setup_component(hass, 'api')
hass.http.app[KEY_TRUSTED_NETWORKS] = [
ip_network(trusted_network)
+3 -3
View File
@@ -5,7 +5,7 @@ from unittest.mock import patch, mock_open
import requests
from homeassistant import bootstrap, const
from homeassistant import setup, const
import homeassistant.components.http as http
from homeassistant.components.http.const import (
KEY_BANS_ENABLED, KEY_LOGIN_THRESHOLD, KEY_BANNED_IPS)
@@ -38,7 +38,7 @@ def setUpModule():
hass = get_test_home_assistant()
bootstrap.setup_component(
setup.setup_component(
hass, http.DOMAIN, {
http.DOMAIN: {
http.CONF_API_PASSWORD: API_PASSWORD,
@@ -47,7 +47,7 @@ def setUpModule():
}
)
bootstrap.setup_component(hass, 'api')
setup.setup_component(hass, 'api')
hass.http.app[KEY_BANNED_IPS] = [IpBan(banned_ip) for banned_ip
in BANNED_IPS]
+9 -9
View File
@@ -2,7 +2,7 @@
import asyncio
import requests
from homeassistant import bootstrap, const
from homeassistant import setup, const
import homeassistant.components.http as http
from tests.common import get_test_instance_port, get_test_home_assistant
@@ -32,7 +32,7 @@ def setUpModule():
hass = get_test_home_assistant()
bootstrap.setup_component(
setup.setup_component(
hass, http.DOMAIN, {
http.DOMAIN: {
http.CONF_API_PASSWORD: API_PASSWORD,
@@ -42,7 +42,7 @@ def setUpModule():
}
)
bootstrap.setup_component(hass, 'api')
setup.setup_component(hass, 'api')
# Registering static path as it caused CORS to blow up
hass.http.register_static_path(
@@ -131,7 +131,7 @@ class TestView(http.HomeAssistantView):
@asyncio.coroutine
def test_registering_view_while_running(hass, test_client):
"""Test that we can register a view while the server is running."""
yield from bootstrap.async_setup_component(
yield from setup.async_setup_component(
hass, http.DOMAIN, {
http.DOMAIN: {
http.CONF_SERVER_PORT: get_test_instance_port(),
@@ -139,7 +139,7 @@ def test_registering_view_while_running(hass, test_client):
}
)
yield from bootstrap.async_setup_component(hass, 'api')
yield from setup.async_setup_component(hass, 'api')
yield from hass.async_start()
@@ -159,7 +159,7 @@ def test_registering_view_while_running(hass, test_client):
@asyncio.coroutine
def test_api_base_url_with_domain(hass):
"""Test setting api url."""
result = yield from bootstrap.async_setup_component(hass, 'http', {
result = yield from setup.async_setup_component(hass, 'http', {
'http': {
'base_url': 'example.com'
}
@@ -171,7 +171,7 @@ def test_api_base_url_with_domain(hass):
@asyncio.coroutine
def test_api_base_url_with_ip(hass):
"""Test setting api url."""
result = yield from bootstrap.async_setup_component(hass, 'http', {
result = yield from setup.async_setup_component(hass, 'http', {
'http': {
'server_host': '1.1.1.1'
}
@@ -183,7 +183,7 @@ def test_api_base_url_with_ip(hass):
@asyncio.coroutine
def test_api_base_url_with_ip_port(hass):
"""Test setting api url."""
result = yield from bootstrap.async_setup_component(hass, 'http', {
result = yield from setup.async_setup_component(hass, 'http', {
'http': {
'base_url': '1.1.1.1:8124'
}
@@ -195,7 +195,7 @@ def test_api_base_url_with_ip_port(hass):
@asyncio.coroutine
def test_api_no_base_url(hass):
"""Test setting api url."""
result = yield from bootstrap.async_setup_component(hass, 'http', {
result = yield from setup.async_setup_component(hass, 'http', {
'http': {
}
})