Custom component loading cleanup (#14211)
* Clean up custom component loading * Fix some tests * Fix some stuff * Make imports work again * Fix tests * Remove debug print * Lint
This commit is contained in:
parent
5d96751168
commit
83d300fd11
50 changed files with 315 additions and 392 deletions
|
@ -17,7 +17,7 @@ class TestSwitch(unittest.TestCase):
|
|||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
platform = loader.get_component('switch.test')
|
||||
platform = loader.get_component(self.hass, 'switch.test')
|
||||
platform.init()
|
||||
# Switch 1 is ON, switch 2 is OFF
|
||||
self.switch_1, self.switch_2, self.switch_3 = \
|
||||
|
@ -79,10 +79,10 @@ class TestSwitch(unittest.TestCase):
|
|||
def test_setup_two_platforms(self):
|
||||
"""Test with bad configuration."""
|
||||
# Test if switch component returns 0 switches
|
||||
test_platform = loader.get_component('switch.test')
|
||||
test_platform = loader.get_component(self.hass, 'switch.test')
|
||||
test_platform.init(True)
|
||||
|
||||
loader.set_component('switch.test2', test_platform)
|
||||
loader.set_component(self.hass, 'switch.test2', test_platform)
|
||||
test_platform.init(False)
|
||||
|
||||
self.assertTrue(setup_component(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue