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 2016-09-17 10:29:58 -07:00 committed by GitHub
parent d7452f9d5d
commit 4076ccf639
29 changed files with 220 additions and 141 deletions

View file

@ -3,6 +3,7 @@
import unittest
import os
from homeassistant.bootstrap import setup_component
import homeassistant.loader as loader
from homeassistant.const import (
ATTR_ENTITY_ID, STATE_ON, STATE_OFF, CONF_PLATFORM,
@ -112,7 +113,8 @@ class TestLight(unittest.TestCase):
platform.init()
self.assertTrue(
light.setup(self.hass, {light.DOMAIN: {CONF_PLATFORM: 'test'}}))
setup_component(self.hass, light.DOMAIN,
{light.DOMAIN: {CONF_PLATFORM: 'test'}}))
dev1, dev2, dev3 = platform.DEVICES
@ -250,8 +252,8 @@ class TestLight(unittest.TestCase):
user_file.write('id,x,y,brightness\n')
user_file.write('I,WILL,NOT,WORK\n')
self.assertFalse(light.setup(
self.hass, {light.DOMAIN: {CONF_PLATFORM: 'test'}}
self.assertFalse(setup_component(
self.hass, light.DOMAIN, {light.DOMAIN: {CONF_PLATFORM: 'test'}}
))
def test_light_profiles(self):
@ -265,8 +267,8 @@ class TestLight(unittest.TestCase):
user_file.write('id,x,y,brightness\n')
user_file.write('test,.4,.6,100\n')
self.assertTrue(light.setup(
self.hass, {light.DOMAIN: {CONF_PLATFORM: 'test'}}
self.assertTrue(setup_component(
self.hass, light.DOMAIN, {light.DOMAIN: {CONF_PLATFORM: 'test'}}
))
dev1, dev2, dev3 = platform.DEVICES