mirror of
https://github.com/elisspace/core.git
synced 2026-09-30 06:19:55 +00:00
Added tests for switch component
This commit is contained in:
@@ -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'))
|
||||
|
||||
Reference in New Issue
Block a user