Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoona Hoikkala <joona@kuori.org>2017-10-13 14:06:08 +0300
committerJoona Hoikkala <joona@kuori.org>2017-10-13 14:06:08 +0300
commitfc53fea279d4d7fe08d325ba35d082f7de4df2f0 (patch)
tree5a5cf116daa270e8f67c8abeb1cfbc517324c250
parenta8b51f8f5ea9de3c3dccc8e69e96daf99c7033d1 (diff)
Added testcaseignore-menu
-rw-r--r--certbot/plugins/webroot_test.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/certbot/plugins/webroot_test.py b/certbot/plugins/webroot_test.py
index 6e67ddf28..5a311716e 100644
--- a/certbot/plugins/webroot_test.py
+++ b/certbot/plugins/webroot_test.py
@@ -145,6 +145,22 @@ class AuthenticatorTest(unittest.TestCase):
mock_chown.side_effect = OSError(errno.EACCES, "msg")
self.auth.perform([self.achall]) # exception caught and logged
+
+ @test_util.patch_get_utility()
+ def test_perform_new_webroot_not_in_map(self, mock_get_utility):
+ new_webroot = tempfile.mkdtemp()
+ self.config.webroot_path = []
+ self.config.webroot_map = {"whatever.com": self.path}
+ mock_display = mock_get_utility()
+ mock_display.menu.side_effect = ((display_util.OK, 0),
+ (display_util.OK, new_webroot))
+ achall = achallenges.KeyAuthorizationAnnotatedChallenge(
+ challb=acme_util.HTTP01_P, domain="something.com", account_key=KEY)
+ with mock.patch('certbot.display.ops.validated_directory') as m:
+ m.return_value = (display_util.OK, new_webroot,)
+ self.auth.perform([achall])
+ self.assertEqual(self.config.webroot_map[achall.domain], new_webroot)
+
def test_perform_permissions(self):
self.auth.prepare()