Async bootstrap / component init (#3991)

* Async bootstrap

* Adress comments

* Fix tests

* More fixes

* Tests fixes
This commit is contained in:
Pascal Vizeli authored and Paulus Schoutsen committed 2016-10-27 00:16:23 -07:00
1 parent d9999f36e8
commit d5368f6f78
54 files changed
+1431 -1131

No files matched your search

+4 -4
View File
@@ -1,7 +1,7 @@
"""The tests for the MQTT switch platform."""
import unittest
from homeassistant.bootstrap import _setup_component
from homeassistant.bootstrap import setup_component
from homeassistant.const import STATE_ON, STATE_OFF, ATTR_ASSUMED_STATE
import homeassistant.components.switch as switch
from tests.common import (
@@ -23,7 +23,7 @@ class TestSensorMQTT(unittest.TestCase):
def test_controlling_state_via_topic(self):
"""Test the controlling state via topic."""
self.hass.config.components = ['mqtt']
assert _setup_component(self.hass, switch.DOMAIN, {
assert setup_component(self.hass, switch.DOMAIN, {
switch.DOMAIN: {
'platform': 'mqtt',
'name': 'test',
@@ -53,7 +53,7 @@ class TestSensorMQTT(unittest.TestCase):
def test_sending_mqtt_commands_and_optimistic(self):
"""Test the sending MQTT commands in optimistic mode."""
self.hass.config.components = ['mqtt']
assert _setup_component(self.hass, switch.DOMAIN, {
assert setup_component(self.hass, switch.DOMAIN, {
switch.DOMAIN: {
'platform': 'mqtt',
'name': 'test',
@@ -87,7 +87,7 @@ class TestSensorMQTT(unittest.TestCase):
def test_controlling_state_via_topic_and_json_message(self):
"""Test the controlling state via topic and JSON message."""
self.hass.config.components = ['mqtt']
assert _setup_component(self.hass, switch.DOMAIN, {
assert setup_component(self.hass, switch.DOMAIN, {
switch.DOMAIN: {
'platform': 'mqtt',
'name': 'test',