mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 19:52:34 +02:00
add back in email test
This commit is contained in:
@@ -59,6 +59,18 @@ class RegisterTest(unittest.TestCase):
|
|||||||
with mock.patch("certbot.account.report_new_account"):
|
with mock.patch("certbot.account.report_new_account"):
|
||||||
self._call()
|
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")
|
@mock.patch("certbot.account.report_new_account")
|
||||||
def test_email_invalid_noninteractive(self, _rep):
|
def test_email_invalid_noninteractive(self, _rep):
|
||||||
from acme import messages
|
from acme import messages
|
||||||
|
|||||||
Reference in New Issue
Block a user