File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,18 @@ def test_it(self):
59
59
with mock .patch ("certbot.account.report_new_account" ):
60
60
self ._call ()
61
61
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
+
62
74
@mock .patch ("certbot.account.report_new_account" )
63
75
def test_email_invalid_noninteractive (self , _rep ):
64
76
from acme import messages
You can’t perform that action at this time.
0 commit comments