Skip to content

Commit 93047d6

Browse files
committed
add back in email test
1 parent ceb5207 commit 93047d6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

certbot/tests/client_test.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ def test_it(self):
5959
with mock.patch("certbot.account.report_new_account"):
6060
self._call()
6161

62+
@mock.patch("certbot.account.report_new_account")
63+
@mock.patch("certbot.client.display_ops.get_email")
64+
def test_email_retry(self, _rep, mock_get_email):
65+
from acme import messages
66+
self.config.noninteractive_mode = False
67+
msg = "DNS problem: NXDOMAIN looking up MX for example.com"
68+
mx_err = messages.Error(detail=msg, typ="urn:acme:error:invalidEmail")
69+
with mock.patch("certbot.client.acme_client.Client") as mock_client:
70+
mock_client().register.side_effect = [mx_err, mock.MagicMock()]
71+
self._call()
72+
self.assertEqual(mock_get_email.call_count, 1)
73+
6274
@mock.patch("certbot.account.report_new_account")
6375
def test_email_invalid_noninteractive(self, _rep):
6476
from acme import messages

0 commit comments

Comments
 (0)