Async bootstrap / component init (#3991)
* Async bootstrap * Adress comments * Fix tests * More fixes * Tests fixes
This commit is contained in:
parent
d9999f36e8
commit
d5368f6f78
54 changed files with 1431 additions and 1131 deletions
|
@ -1,7 +1,7 @@
|
|||
"""The tests for the MQTT binary sensor platform."""
|
||||
import unittest
|
||||
|
||||
from homeassistant.bootstrap import _setup_component
|
||||
from homeassistant.bootstrap import setup_component
|
||||
import homeassistant.components.binary_sensor as binary_sensor
|
||||
from tests.common import mock_mqtt_component, fire_mqtt_message
|
||||
from homeassistant.const import (STATE_OFF, STATE_ON)
|
||||
|
@ -24,7 +24,7 @@ class TestSensorMQTT(unittest.TestCase):
|
|||
def test_setting_sensor_value_via_mqtt_message(self):
|
||||
"""Test the setting of the value via MQTT."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
assert _setup_component(self.hass, binary_sensor.DOMAIN, {
|
||||
assert setup_component(self.hass, binary_sensor.DOMAIN, {
|
||||
binary_sensor.DOMAIN: {
|
||||
'platform': 'mqtt',
|
||||
'name': 'test',
|
||||
|
@ -50,7 +50,7 @@ class TestSensorMQTT(unittest.TestCase):
|
|||
def test_valid_sensor_class(self):
|
||||
"""Test the setting of a valid sensor class."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
assert _setup_component(self.hass, binary_sensor.DOMAIN, {
|
||||
assert setup_component(self.hass, binary_sensor.DOMAIN, {
|
||||
binary_sensor.DOMAIN: {
|
||||
'platform': 'mqtt',
|
||||
'name': 'test',
|
||||
|
@ -65,7 +65,7 @@ class TestSensorMQTT(unittest.TestCase):
|
|||
def test_invalid_sensor_class(self):
|
||||
"""Test the setting of an invalid sensor class."""
|
||||
self.hass.config.components = ['mqtt']
|
||||
assert _setup_component(self.hass, binary_sensor.DOMAIN, {
|
||||
assert setup_component(self.hass, binary_sensor.DOMAIN, {
|
||||
binary_sensor.DOMAIN: {
|
||||
'platform': 'mqtt',
|
||||
'name': 'test',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue