No longer mask failed challenge errors with encoding errors (#4867)

*     no longer masker failed challenge errors with encoding errors

* simplifying through type-checking

* bytes
This commit is contained in:
yomna
2017-07-10 21:05:52 -05:00
committed by Brad Warren
parent 48ef16ab0d
commit bc3765d6d0
4 changed files with 30 additions and 12 deletions
-1
View File
@@ -28,7 +28,6 @@ logger = logging.getLogger(__name__)
# pylint: disable=too-few-public-methods
class AnnotatedChallenge(jose.ImmutableMap):
"""Client annotated challenge.
+11
View File
@@ -23,6 +23,17 @@ class FailedChallengesTest(unittest.TestCase):
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."""