mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 03:22:14 +02:00
test config_test failure
This commit is contained in:
@@ -28,6 +28,7 @@ class InstallerTest(certbot_test_util.ConfigTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(InstallerTest, self).setUp()
|
||||
self.config.postfix_ctl = "postfix"
|
||||
self.config.postfix_config_dir = self.tempdir
|
||||
self.config.postfix_config_utility = "postconf"
|
||||
|
||||
@@ -94,6 +95,12 @@ class InstallerTest(certbot_test_util.ConfigTestCase):
|
||||
self.assertEqual(
|
||||
self._create_prepared_installer().supported_enhancements(), [])
|
||||
|
||||
@mock.patch("certbot_postfix.installer.subprocess.check_call")
|
||||
def test_config_test_failure(self, mock_check_call):
|
||||
installer = self._create_prepared_installer()
|
||||
mock_check_call.side_effect = subprocess.CalledProcessError(42, "foo")
|
||||
self.assertRaises(errors.MisconfigurationError, installer.config_test)
|
||||
|
||||
def test_get_config_var_success(self):
|
||||
self.config.postfix_config_dir = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user