mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
add back in email test
This commit is contained in:
parent
ceb5207d56
commit
93047d6579
1 changed files with 12 additions and 0 deletions
|
|
@ -59,6 +59,18 @@ class RegisterTest(unittest.TestCase):
|
|||
with mock.patch("certbot.account.report_new_account"):
|
||||
self._call()
|
||||
|
||||
@mock.patch("certbot.account.report_new_account")
|
||||
@mock.patch("certbot.client.display_ops.get_email")
|
||||
def test_email_retry(self, _rep, mock_get_email):
|
||||
from acme import messages
|
||||
self.config.noninteractive_mode = False
|
||||
msg = "DNS problem: NXDOMAIN looking up MX for example.com"
|
||||
mx_err = messages.Error(detail=msg, typ="urn:acme:error:invalidEmail")
|
||||
with mock.patch("certbot.client.acme_client.Client") as mock_client:
|
||||
mock_client().register.side_effect = [mx_err, mock.MagicMock()]
|
||||
self._call()
|
||||
self.assertEqual(mock_get_email.call_count, 1)
|
||||
|
||||
@mock.patch("certbot.account.report_new_account")
|
||||
def test_email_invalid_noninteractive(self, _rep):
|
||||
from acme import messages
|
||||
|
|
|
|||
Loading…
Reference in a new issue