mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Async bootstrap / component init (#3991)
* Async bootstrap * Adress comments * Fix tests * More fixes * Tests fixes
This commit is contained in:
committed by
Paulus Schoutsen
parent
d9999f36e8
commit
d5368f6f78
@@ -1,7 +1,7 @@
|
||||
"""The tests for the MQTT lock platform."""
|
||||
import unittest
|
||||
|
||||
from homeassistant.bootstrap import _setup_component
|
||||
from homeassistant.bootstrap import setup_component
|
||||
from homeassistant.const import (STATE_LOCKED, STATE_UNLOCKED,
|
||||
ATTR_ASSUMED_STATE)
|
||||
import homeassistant.components.lock as lock
|
||||
@@ -24,7 +24,7 @@ class TestLockMQTT(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, lock.DOMAIN, {
|
||||
assert setup_component(self.hass, lock.DOMAIN, {
|
||||
lock.DOMAIN: {
|
||||
'platform': 'mqtt',
|
||||
'name': 'test',
|
||||
@@ -54,7 +54,7 @@ class TestLockMQTT(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, lock.DOMAIN, {
|
||||
assert setup_component(self.hass, lock.DOMAIN, {
|
||||
lock.DOMAIN: {
|
||||
'platform': 'mqtt',
|
||||
'name': 'test',
|
||||
@@ -88,7 +88,7 @@ class TestLockMQTT(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, lock.DOMAIN, {
|
||||
assert setup_component(self.hass, lock.DOMAIN, {
|
||||
lock.DOMAIN: {
|
||||
'platform': 'mqtt',
|
||||
'name': 'test',
|
||||
|
||||
Reference in New Issue
Block a user