mirror of
https://github.com/certbot/certbot.git
synced 2026-07-31 18:34:41 +02:00
Add test for nginx not being installed
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
# pylint: disable=too-many-public-methods
|
||||
"""Test for letsencrypt_nginx.configurator."""
|
||||
import os
|
||||
import shutil
|
||||
@@ -29,6 +30,12 @@ class NginxConfiguratorTest(util.NginxTest):
|
||||
shutil.rmtree(self.config_dir)
|
||||
shutil.rmtree(self.work_dir)
|
||||
|
||||
@mock.patch("letsencrypt_nginx.configurator.le_util.exe_exists")
|
||||
def test_prepare_no_install(self, mock_exe_exists):
|
||||
mock_exe_exists.return_value = False
|
||||
self.assertRaises(
|
||||
errors.NoInstallationError, self.config.prepare)
|
||||
|
||||
def test_prepare(self):
|
||||
self.assertEquals((1, 6, 2), self.config.version)
|
||||
self.assertEquals(5, len(self.config.parser.parsed))
|
||||
|
||||
Reference in New Issue
Block a user