Use setup_component in tests (#3414)
* Alarm Control Panel Manual - use setup_component * Update automation - zone tests * Update climate - demo tests * Update climate - generic thermostat tests * Update cover - command line tests * Update cover - demo tests * Update device tracker tests * Update device tracker - owntracks tests * Update fan - demo tests * Update garage door - demo tests * Update light tests * Update lock - demo tests * Update media player - demo tests * Update notify - command line tests * Update notify - demo tests * Update notify - file tests * Update notify - group tests * Update sensor - mfi tests * Update sensor - moldindicator tests * Update sensor - mqtt room tests * Update switch - command line * Update switch - flux * Update switch tests * Update scene tests * Fix wrong default port for mfi switch
This commit is contained in:
1 parent
d7452f9d5d
commit
4076ccf639
29 files changed
+220
-141
No files matched your search
@@ -1,7 +1,7 @@
|
||||
"""The tests for the location automation."""
|
||||
import unittest
|
||||
|
||||
from homeassistant.bootstrap import _setup_component
|
||||
from homeassistant.bootstrap import setup_component
|
||||
from homeassistant.components import automation, zone
|
||||
|
||||
from tests.common import get_test_home_assistant
|
||||
@@ -14,7 +14,7 @@ class TestAutomationZone(unittest.TestCase):
|
||||
"""Setup things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
self.hass.config.components.append('group')
|
||||
zone.setup(self.hass, {
|
||||
assert setup_component(self.hass, zone.DOMAIN, {
|
||||
'zone': {
|
||||
'name': 'test',
|
||||
'latitude': 32.880837,
|
||||
@@ -42,7 +42,7 @@ class TestAutomationZone(unittest.TestCase):
|
||||
})
|
||||
self.hass.block_till_done()
|
||||
|
||||
assert _setup_component(self.hass, automation.DOMAIN, {
|
||||
assert setup_component(self.hass, automation.DOMAIN, {
|
||||
automation.DOMAIN: {
|
||||
'trigger': {
|
||||
'platform': 'zone',
|
||||
@@ -100,7 +100,7 @@ class TestAutomationZone(unittest.TestCase):
|
||||
})
|
||||
self.hass.block_till_done()
|
||||
|
||||
assert _setup_component(self.hass, automation.DOMAIN, {
|
||||
assert setup_component(self.hass, automation.DOMAIN, {
|
||||
automation.DOMAIN: {
|
||||
'trigger': {
|
||||
'platform': 'zone',
|
||||
@@ -130,7 +130,7 @@ class TestAutomationZone(unittest.TestCase):
|
||||
})
|
||||
self.hass.block_till_done()
|
||||
|
||||
assert _setup_component(self.hass, automation.DOMAIN, {
|
||||
assert setup_component(self.hass, automation.DOMAIN, {
|
||||
automation.DOMAIN: {
|
||||
'trigger': {
|
||||
'platform': 'zone',
|
||||
@@ -160,7 +160,7 @@ class TestAutomationZone(unittest.TestCase):
|
||||
})
|
||||
self.hass.block_till_done()
|
||||
|
||||
assert _setup_component(self.hass, automation.DOMAIN, {
|
||||
assert setup_component(self.hass, automation.DOMAIN, {
|
||||
automation.DOMAIN: {
|
||||
'trigger': {
|
||||
'platform': 'zone',
|
||||
@@ -190,7 +190,7 @@ class TestAutomationZone(unittest.TestCase):
|
||||
})
|
||||
self.hass.block_till_done()
|
||||
|
||||
assert _setup_component(self.hass, automation.DOMAIN, {
|
||||
assert setup_component(self.hass, automation.DOMAIN, {
|
||||
automation.DOMAIN: {
|
||||
'trigger': {
|
||||
'platform': 'event',
|
||||
|
||||
Reference in new issue
Block a user