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:
Paulus Schoutsen authored and GitHub committed 2016-09-17 10:29:58 -07:00
1 parent d7452f9d5d
commit 4076ccf639
29 files changed
+220 -141

No files matched your search

+5 -4
View File
@@ -4,6 +4,7 @@ import os
import tempfile
import unittest
from homeassistant.bootstrap import setup_component
from homeassistant.const import STATE_ON, STATE_OFF
import homeassistant.components.switch as switch
import homeassistant.components.switch.command_line as command_line
@@ -30,7 +31,7 @@ class TestCommandSwitch(unittest.TestCase):
'command_on': 'echo 1 > {}'.format(path),
'command_off': 'echo 0 > {}'.format(path),
}
self.assertTrue(switch.setup(self.hass, {
self.assertTrue(setup_component(self.hass, switch.DOMAIN, {
'switch': {
'platform': 'command_line',
'switches': {
@@ -64,7 +65,7 @@ class TestCommandSwitch(unittest.TestCase):
'command_off': 'echo 0 > {}'.format(path),
'value_template': '{{ value=="1" }}'
}
self.assertTrue(switch.setup(self.hass, {
self.assertTrue(setup_component(self.hass, switch.DOMAIN, {
'switch': {
'platform': 'command_line',
'switches': {
@@ -100,7 +101,7 @@ class TestCommandSwitch(unittest.TestCase):
'command_off': 'echo \'{}\' > {}'.format(offcmd, path),
'value_template': '{{ value_json.status=="ok" }}'
}
self.assertTrue(switch.setup(self.hass, {
self.assertTrue(setup_component(self.hass, switch.DOMAIN, {
'switch': {
'platform': 'command_line',
'switches': {
@@ -133,7 +134,7 @@ class TestCommandSwitch(unittest.TestCase):
'command_on': 'echo 1 > {}'.format(path),
'command_off': 'echo 0 > {}'.format(path),
}
self.assertTrue(switch.setup(self.hass, {
self.assertTrue(setup_component(self.hass, switch.DOMAIN, {
'switch': {
'platform': 'command_line',
'switches': {