Add check_config API (#5898)

* Add check_config API

* Add config panel to default config

* Add tests

* Lint

* lint
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2017-02-12 11:31:46 -08:00
1 parent dc6a28a8b2
commit dab6d011ca
7 files changed
+107 -28

No files matched your search

+5 -6
View File
@@ -396,16 +396,15 @@ class TestConfig(unittest.TestCase):
process_mock = mock.MagicMock()
attrs = {
'communicate.return_value':
mock_generator((r'\033[hellom'.encode('utf-8'), 'error')),
mock_generator(('\033[34mhello'.encode('utf-8'), 'error')),
'wait.return_value': mock_generator(1)}
process_mock.configure_mock(**attrs)
mock_create.return_value = mock_generator(process_mock)
with self.assertRaises(HomeAssistantError):
run_coroutine_threadsafe(
config_util.async_check_ha_config_file(self.hass),
self.hass.loop
).result()
assert run_coroutine_threadsafe(
config_util.async_check_ha_config_file(self.hass),
self.hass.loop
).result() == 'hello'
# pylint: disable=redefined-outer-name