Fix check config script (#23151)

* Fix check config script

* Fix typings

* Fix test
This commit is contained in:
Paulus Schoutsen authored and Jason Hu committed 2019-04-16 17:14:25 -07:00
1 parent 1bfccd803f
commit 37ca9cabd1
3 files changed
+24 -23

No files matched your search

+4 -2
View File
@@ -539,7 +539,8 @@ class TestConfig(unittest.TestCase):
assert len(self.hass.config.whitelist_external_dirs) == 1
assert "/test/config/www" in self.hass.config.whitelist_external_dirs
@mock.patch('homeassistant.scripts.check_config.check_ha_config_file')
@asynctest.mock.patch(
'homeassistant.scripts.check_config.check_ha_config_file')
def test_check_ha_config_file_correct(self, mock_check):
"""Check that restart propagates to stop."""
mock_check.return_value = check_config.HomeAssistantConfig()
@@ -548,7 +549,8 @@ class TestConfig(unittest.TestCase):
self.hass.loop
).result() is None
@mock.patch('homeassistant.scripts.check_config.check_ha_config_file')
@asynctest.mock.patch(
'homeassistant.scripts.check_config.check_ha_config_file')
def test_check_ha_config_file_wrong(self, mock_check):
"""Check that restart with a bad config doesn't propagate to stop."""
mock_check.return_value = check_config.HomeAssistantConfig()