Added tests for switch component

This commit is contained in:
Paulus Schoutsen
2014-11-25 00:20:36 -08:00
parent 8c56b415cb
commit 5cbe7bf1b8
6 changed files with 169 additions and 2 deletions
+9
View File
@@ -11,6 +11,8 @@ import homeassistant as ha
import homeassistant.loader as loader
import homeassistant.components.http as http
from mock import switch_platform
class TestLoader(unittest.TestCase):
""" Test the loader module. """
@@ -22,6 +24,13 @@ class TestLoader(unittest.TestCase):
""" Stop down stuff we started. """
self.hass._pool.stop()
def test_set_component(self):
""" Test if set_component works. """
loader.set_component('switch.test', switch_platform)
self.assertEqual(
switch_platform, loader.get_component('switch.test'))
def test_get_component(self):
""" Test if get_component works. """
self.assertEqual(http, loader.get_component('http'))