Clean up mock_coro (#6037)

This commit is contained in:
Paulus Schoutsen 2017-02-15 23:19:34 -08:00 committed by GitHub
parent 9c176ad85a
commit 75e41a21c9
12 changed files with 37 additions and 42 deletions

View file

@ -153,7 +153,7 @@ class TestComponentsCore(unittest.TestCase):
assert mock_process.called is False
@patch('homeassistant.core.HomeAssistant.async_stop',
return_value=mock_coro()())
return_value=mock_coro())
def test_stop_homeassistant(self, mock_stop):
"""Test stop service."""
comps.stop(self.hass)
@ -161,9 +161,9 @@ class TestComponentsCore(unittest.TestCase):
assert mock_stop.called
@patch('homeassistant.core.HomeAssistant.async_stop',
return_value=mock_coro()())
return_value=mock_coro())
@patch('homeassistant.config.async_check_ha_config_file',
return_value=mock_coro()())
return_value=mock_coro())
def test_restart_homeassistant(self, mock_check, mock_restart):
"""Test stop service."""
comps.restart(self.hass)
@ -172,7 +172,7 @@ class TestComponentsCore(unittest.TestCase):
assert mock_check.called
@patch('homeassistant.core.HomeAssistant.async_stop',
return_value=mock_coro()())
return_value=mock_coro())
@patch('homeassistant.config.async_check_ha_config_file',
side_effect=HomeAssistantError("Test error"))
def test_restart_homeassistant_wrong_conf(self, mock_check, mock_restart):
@ -183,9 +183,9 @@ class TestComponentsCore(unittest.TestCase):
assert not mock_restart.called
@patch('homeassistant.core.HomeAssistant.async_stop',
return_value=mock_coro()())
return_value=mock_coro())
@patch('homeassistant.config.async_check_ha_config_file',
return_value=mock_coro()())
return_value=mock_coro())
def test_check_config(self, mock_check, mock_stop):
"""Test stop service."""
comps.check_config(self.hass)