mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
Added testcase
This commit is contained in:
parent
a8b51f8f5e
commit
fc53fea279
1 changed files with 16 additions and 0 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue