Test coverage for NoInstallationError

This commit is contained in:
Joona Hoikkala 2016-06-06 12:36:54 +03:00
parent 08ccc64cd1
commit 7239361342
No known key found for this signature in database
GPG key ID: C14AAE0F5ADCB854

View file

@ -55,6 +55,14 @@ class MultipleVhostsTest(util.ApacheTest):
self.assertRaises(
errors.NoInstallationError, self.config.prepare)
@mock.patch("certbot_apache.augeas_configurator.AugeasConfigurator.init_augeas")
def test_prepare_no_augeas(self, mock_init_augeas):
def side_effect_error(*args, **kwargs):
raise ImportError
mock_init_augeas.side_effect = side_effect_error
self.assertRaises(
errors.NoInstallationError, self.config.prepare)
@mock.patch("certbot_apache.parser.ApacheParser")
@mock.patch("certbot_apache.configurator.util.exe_exists")
def test_prepare_version(self, mock_exe_exists, _):