SHA256
1
0
forked from pool/python
Matej Cepl 2022-11-10 14:35:05 +00:00 committed by Git OBS Bridge
parent 3f9f4e7cb7
commit 615a636d68

View File

@ -69,9 +69,9 @@ Co-authored-by: Gregory P. Smith <greg@krypto.org>
self.assertEqual(u"pyth\xf6n.org.".encode("idna"), "xn--pythn-mua.org.")
+ def test_builtin_decode_length_limit(self):
+ with self.assertRaisesRegex(UnicodeError, "too long"):
+ with self.assertRaisesRegexp(UnicodeError, "too long"):
+ (b"xn--016c"+b"a"*1100).decode("idna")
+ with self.assertRaisesRegex(UnicodeError, "too long"):
+ with self.assertRaisesRegexp(UnicodeError, "too long"):
+ (b"xn--016c"+b"a"*70).decode("idna")
+
def test_stream(self):