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:
Paulus Schoutsen 2018-05-01 14:57:30 -04:00 committed by Pascal Vizeli
parent 5d96751168
commit 83d300fd11
50 changed files with 315 additions and 392 deletions

View file

@ -7,7 +7,6 @@ from unittest.mock import patch
import homeassistant.scripts.check_config as check_config
from homeassistant.config import YAML_CONFIG_FILE
from homeassistant.loader import set_component
from tests.common import patch_yaml_files, get_test_config_dir
_LOGGER = logging.getLogger(__name__)
@ -106,7 +105,6 @@ class TestCheckConfig(unittest.TestCase):
def test_component_platform_not_found(self, isfile_patch):
"""Test errors if component or platform not found."""
# Make sure they don't exist
set_component('beer', None)
files = {
YAML_CONFIG_FILE: BASE_CONFIG + 'beer:',
}
@ -119,7 +117,6 @@ class TestCheckConfig(unittest.TestCase):
assert res['secrets'] == {}
assert len(res['yaml_files']) == 1
set_component('light.beer', None)
files = {
YAML_CONFIG_FILE: BASE_CONFIG + 'light:\n platform: beer',
}