mirror of
https://github.com/certbot/certbot.git
synced 2026-06-04 06:15:36 -04:00
Test restart command.
This commit is contained in:
parent
218e15c9d4
commit
b21b66c0c0
1 changed files with 27 additions and 0 deletions
|
|
@ -103,6 +103,33 @@ class InstallerTest(certbot_test_util.ConfigTestCase):
|
|||
mock_check_call.side_effect = subprocess.CalledProcessError(42, "foo")
|
||||
self.assertRaises(errors.MisconfigurationError, installer.config_test)
|
||||
|
||||
@mock.patch("certbot_postfix.installer.subprocess.check_call")
|
||||
def test_postfix_reload_failure(self, mock_check_call):
|
||||
installer = self._create_prepared_installer()
|
||||
mock_check_call.side_effect = [
|
||||
None, subprocess.CalledProcessError(42, "foo")
|
||||
]
|
||||
self.assertRaises(errors.PluginError, installer.restart)
|
||||
|
||||
@mock.patch("certbot_postfix.installer.subprocess.check_call")
|
||||
def test_postfix_reload_success(self, mock_check_call):
|
||||
installer = self._create_prepared_installer()
|
||||
installer.restart()
|
||||
|
||||
@mock.patch("certbot_postfix.installer.subprocess.check_call")
|
||||
def test_postfix_start_failure(self, mock_check_call):
|
||||
installer = self._create_prepared_installer()
|
||||
mock_check_call.side_effect = subprocess.CalledProcessError(42, "foo")
|
||||
self.assertRaises(errors.PluginError, installer.restart)
|
||||
|
||||
@mock.patch("certbot_postfix.installer.subprocess.check_call")
|
||||
def test_postfix_start_success(self, mock_check_call):
|
||||
installer = self._create_prepared_installer()
|
||||
mock_check_call.side_effect = [
|
||||
subprocess.CalledProcessError(42, "foo"), None
|
||||
]
|
||||
installer.restart()
|
||||
|
||||
def test_get_config_var_success(self):
|
||||
self.config.postfix_config_dir = None
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue