Fix PEP257 issues
This commit is contained in:
1 parent
d6eab03a61
commit
9838697d2b
120 files changed
+1447
-1297
No files matched your search
+9
-11
@@ -1,9 +1,4 @@
|
||||
"""
|
||||
tests.test_loader
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Provides tests to verify that we can load components.
|
||||
"""
|
||||
"""Test to verify that we can load components."""
|
||||
# pylint: disable=too-many-public-methods,protected-access
|
||||
import unittest
|
||||
|
||||
@@ -14,28 +9,30 @@ from tests.common import get_test_home_assistant, MockModule
|
||||
|
||||
|
||||
class TestLoader(unittest.TestCase):
|
||||
""" Test the loader module. """
|
||||
"""Test the loader module."""
|
||||
|
||||
def setUp(self): # pylint: disable=invalid-name
|
||||
"""Setup tests."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
def tearDown(self): # pylint: disable=invalid-name
|
||||
""" Stop down stuff we started. """
|
||||
"""Stop everything that was started."""
|
||||
self.hass.stop()
|
||||
|
||||
def test_set_component(self):
|
||||
""" Test if set_component works. """
|
||||
"""Test if set_component works."""
|
||||
loader.set_component('switch.test_set', http)
|
||||
|
||||
self.assertEqual(http, loader.get_component('switch.test_set'))
|
||||
|
||||
def test_get_component(self):
|
||||
""" Test if get_component works. """
|
||||
"""Test if get_component works."""
|
||||
self.assertEqual(http, loader.get_component('http'))
|
||||
|
||||
self.assertIsNotNone(loader.get_component('switch.test'))
|
||||
|
||||
def test_load_order_component(self):
|
||||
""" Test if we can get the proper load order of components. """
|
||||
"""Test if we can get the proper load order of components."""
|
||||
loader.set_component('mod1', MockModule('mod1'))
|
||||
loader.set_component('mod2', MockModule('mod2', ['mod1']))
|
||||
loader.set_component('mod3', MockModule('mod3', ['mod2']))
|
||||
@@ -57,6 +54,7 @@ class TestLoader(unittest.TestCase):
|
||||
self.assertEqual([], loader.load_order_component('mod1'))
|
||||
|
||||
def test_load_order_components(self):
|
||||
"""Setup loading order of components."""
|
||||
loader.set_component('mod1', MockModule('mod1', ['group']))
|
||||
loader.set_component('mod2', MockModule('mod2', ['mod1', 'sun']))
|
||||
loader.set_component('mod3', MockModule('mod3', ['mod2']))
|
||||
|
||||
Reference in new issue
Block a user