Allow reloading automation without restarting HA (#3002)
This commit is contained in:
parent
641d531be3
commit
e9813b219e
7 changed files with 365 additions and 107 deletions
|
@ -211,19 +211,19 @@ class TestBootstrap:
|
|||
deps = ['non_existing']
|
||||
loader.set_component('comp', MockModule('comp', dependencies=deps))
|
||||
|
||||
assert not bootstrap._setup_component(self.hass, 'comp', None)
|
||||
assert not bootstrap._setup_component(self.hass, 'comp', {})
|
||||
assert 'comp' not in self.hass.config.components
|
||||
|
||||
self.hass.config.components.append('non_existing')
|
||||
|
||||
assert bootstrap._setup_component(self.hass, 'comp', None)
|
||||
assert bootstrap._setup_component(self.hass, 'comp', {})
|
||||
|
||||
def test_component_failing_setup(self):
|
||||
"""Test component that fails setup."""
|
||||
loader.set_component(
|
||||
'comp', MockModule('comp', setup=lambda hass, config: False))
|
||||
|
||||
assert not bootstrap._setup_component(self.hass, 'comp', None)
|
||||
assert not bootstrap._setup_component(self.hass, 'comp', {})
|
||||
assert 'comp' not in self.hass.config.components
|
||||
|
||||
def test_component_exception_setup(self):
|
||||
|
@ -234,7 +234,7 @@ class TestBootstrap:
|
|||
|
||||
loader.set_component('comp', MockModule('comp', setup=exception_setup))
|
||||
|
||||
assert not bootstrap._setup_component(self.hass, 'comp', None)
|
||||
assert not bootstrap._setup_component(self.hass, 'comp', {})
|
||||
assert 'comp' not in self.hass.config.components
|
||||
|
||||
def test_home_assistant_core_config_validation(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue