mirror of
https://github.com/certbot/certbot.git
synced 2026-06-05 06:42:10 -04:00
shrink renewal and installation success messages
This commit is contained in:
parent
b79185ffd6
commit
2e16ef3955
2 changed files with 15 additions and 20 deletions
|
|
@ -240,25 +240,22 @@ def success_installation(domains):
|
|||
:param list domains: domain names which were enabled
|
||||
|
||||
"""
|
||||
z_util(interfaces.IDisplay).notification(
|
||||
"Congratulations! You have successfully enabled {0}".format(
|
||||
_gen_https_names(domains)),
|
||||
pause=False)
|
||||
display_util.notify(
|
||||
"Congratulations! You have successfully enabled HTTPS on {0}"
|
||||
.format(_gen_https_names(domains))
|
||||
)
|
||||
|
||||
|
||||
def success_renewal(domains):
|
||||
def success_renewal(unused_domains):
|
||||
"""Display a box confirming the renewal of an existing certificate.
|
||||
|
||||
:param list domains: domain names which were renewed
|
||||
|
||||
"""
|
||||
z_util(interfaces.IDisplay).notification(
|
||||
display_util.notify(
|
||||
"Your existing certificate has been successfully renewed, and the "
|
||||
"new certificate has been installed.{1}{1}"
|
||||
"The new certificate covers the following domains: {0}".format(
|
||||
_gen_https_names(domains),
|
||||
os.linesep),
|
||||
pause=False)
|
||||
"new certificate has been installed."
|
||||
)
|
||||
|
||||
|
||||
def success_revocation(cert_path):
|
||||
|
|
|
|||
|
|
@ -342,15 +342,16 @@ class SuccessInstallationTest(unittest.TestCase):
|
|||
from certbot.display.ops import success_installation
|
||||
success_installation(names)
|
||||
|
||||
@test_util.patch_get_utility("certbot.display.util.notify")
|
||||
@test_util.patch_get_utility("certbot.display.ops.z_util")
|
||||
def test_success_installation(self, mock_util):
|
||||
def test_success_installation(self, mock_util, mock_notify):
|
||||
mock_util().notification.return_value = None
|
||||
names = ["example.com", "abc.com"]
|
||||
|
||||
self._call(names)
|
||||
|
||||
self.assertEqual(mock_util().notification.call_count, 1)
|
||||
arg = mock_util().notification.call_args_list[0][0][0]
|
||||
self.assertEqual(mock_notify.call_count, 1)
|
||||
arg = mock_notify.call_args_list[0][0][0]
|
||||
|
||||
for name in names:
|
||||
self.assertTrue(name in arg)
|
||||
|
|
@ -363,18 +364,15 @@ class SuccessRenewalTest(unittest.TestCase):
|
|||
from certbot.display.ops import success_renewal
|
||||
success_renewal(names)
|
||||
|
||||
@test_util.patch_get_utility("certbot.display.util.notify")
|
||||
@test_util.patch_get_utility("certbot.display.ops.z_util")
|
||||
def test_success_renewal(self, mock_util):
|
||||
def test_success_renewal(self, mock_util, mock_notify):
|
||||
mock_util().notification.return_value = None
|
||||
names = ["example.com", "abc.com"]
|
||||
|
||||
self._call(names)
|
||||
|
||||
self.assertEqual(mock_util().notification.call_count, 1)
|
||||
arg = mock_util().notification.call_args_list[0][0][0]
|
||||
|
||||
for name in names:
|
||||
self.assertTrue(name in arg)
|
||||
self.assertEqual(mock_notify.call_count, 1)
|
||||
|
||||
class SuccessRevocationTest(unittest.TestCase):
|
||||
"""Test the success revocation message."""
|
||||
|
|
|
|||
Loading…
Reference in a new issue