def test_check_ha_config_file_correct(self, mock_check): """Check that restart propagates to stop.""" mock_check.return_value = check_config.HomeAssistantConfig() assert run_coroutine_threadsafe( config_util.async_check_ha_config_file(self.hass), self.hass.loop ).result() is None
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() mock_check.return_value.add_error("bad") assert run_coroutine_threadsafe( config_util.async_check_ha_config_file(self.hass), self.hass.loop).result() == 'bad'
async def test_check_ha_config_file_wrong(mock_check, hass): """Check that restart with a bad config doesn't propagate to stop.""" mock_check.return_value = check_config.HomeAssistantConfig() mock_check.return_value.add_error("bad") assert await config_util.async_check_ha_config_file(hass) == 'bad'
async def test_check_ha_config_file_correct(mock_check, hass): """Check that restart propagates to stop.""" mock_check.return_value = check_config.HomeAssistantConfig() assert await config_util.async_check_ha_config_file(hass) is None