"""Tests for certbot.errors.""" import unittest import mock from acme import messages from certbot import achallenges from certbot.tests import acme_util class FailedChallengesTest(unittest.TestCase): """Tests for certbot.errors.FailedChallenges.""" def setUp(self): from certbot.errors import FailedChallenges self.error = FailedChallenges(set([achallenges.DNS( domain="example.com", challb=messages.ChallengeBody( chall=acme_util.DNS01, uri=None, error=messages.Error(typ="tls", detail="detail")))])) def test_str(self): self.assertTrue(str(self.error).startswith( "Failed authorization procedure. example.com (dns-01): tls")) def test_unicode(self): from certbot.errors import FailedChallenges arabic_detail = u'\u0639\u062f\u0627\u0644\u0629' arabic_error = FailedChallenges(set([achallenges.DNS( domain="example.com", challb=messages.ChallengeBody( chall=acme_util.DNS01, uri=None, error=messages.Error(typ="tls", detail=arabic_detail)))])) self.assertTrue(str(arabic_error).startswith( "Failed authorization procedure. example.com (dns-01): tls")) class StandaloneBindErrorTest(unittest.TestCase): """Tests for certbot.errors.StandaloneBindError.""" def setUp(self): from certbot.errors import StandaloneBindError self.error = StandaloneBindError(mock.sentinel.error, 1234) def test_instance_args(self): self.assertEqual(mock.sentinel.error, self.error.socket_error) self.assertEqual(1234, self.error.port) def test_str(self): self.assertTrue(str(self.error).startswith( "Problem binding to port 1234: ")) if __name__ == "__main__": unittest.main() # pragma: no cover
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
display | Folder | 0755 |
|
|
testdata | Folder | 0755 |
|
|
__init__.py | File | 20 B | 0644 |
|
account_test.py | File | 14.45 KB | 0644 |
|
acme_util.py | File | 3.18 KB | 0644 |
|
auth_handler_test.py | File | 24 KB | 0644 |
|
cert_manager_test.py | File | 28.07 KB | 0644 |
|
cli_test.py | File | 19.94 KB | 0644 |
|
client_test.py | File | 28.76 KB | 0644 |
|
compat_test.py | File | 736 B | 0644 |
|
configuration_test.py | File | 6.82 KB | 0644 |
|
crypto_util_test.py | File | 13.56 KB | 0644 |
|
eff_test.py | File | 5.94 KB | 0644 |
|
error_handler_test.py | File | 5.31 KB | 0644 |
|
errors_test.py | File | 1.8 KB | 0644 |
|
hook_test.py | File | 16.67 KB | 0644 |
|
lock_test.py | File | 3.84 KB | 0644 |
|
log_test.py | File | 14.95 KB | 0644 |
|
main_test.py | File | 82.52 KB | 0644 |
|
notify_test.py | File | 2.07 KB | 0644 |
|
ocsp_test.py | File | 6.27 KB | 0644 |
|
renewal_test.py | File | 4.18 KB | 0644 |
|
renewupdater_test.py | File | 5.32 KB | 0644 |
|
reporter_test.py | File | 2.73 KB | 0644 |
|
reverter_test.py | File | 18.7 KB | 0644 |
|
storage_test.py | File | 42.89 KB | 0644 |
|
util.py | File | 14.12 KB | 0644 |
|
util_test.py | File | 21.58 KB | 0644 |
|