mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 22:08:07 -04:00
Fix issue with suggest_unsafe undeclared (#3685)
Added missing declaration of support_unsafe and unit test to prevent regression. Issue #3672
This commit is contained in:
parent
d54cb76432
commit
98911d0c3c
2 changed files with 9 additions and 0 deletions
|
|
@ -37,6 +37,7 @@ def get_email(invalid=False, optional=True):
|
|||
if optional:
|
||||
if invalid:
|
||||
msg += unsafe_suggestion
|
||||
suggest_unsafe = False
|
||||
else:
|
||||
suggest_unsafe = True
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -72,6 +72,14 @@ class GetEmailTest(unittest.TestCase):
|
|||
self.assertTrue(
|
||||
"--register-unsafely-without-email" not in call[0][0])
|
||||
|
||||
def test_optional_invalid_unsafe(self):
|
||||
invalid_txt = "There seem to be problems"
|
||||
self.input.return_value = (display_util.OK, "foo@bar.baz")
|
||||
with mock.patch("certbot.display.ops.util.safe_email") as mock_safe_email:
|
||||
mock_safe_email.side_effect = [False, True]
|
||||
self._call(invalid=True)
|
||||
self.assertTrue(invalid_txt in self.input.call_args[0][0])
|
||||
|
||||
|
||||
class ChooseAccountTest(unittest.TestCase):
|
||||
"""Tests for certbot.display.ops.choose_account."""
|
||||
|
|
|
|||
Loading…
Reference in a new issue