https://github.com/python/cpython/commit/802d4954f12541ba28dd7f18bf4a65054941a80d
commit: 802d4954f12541ba28dd7f18bf4a65054941a80d
branch: main
author: Zackery Spytz <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2024-01-08T13:01:31+02:00
summary:

gh-74678: Increase base64 test coverage (GH-21913)

Ensure the character y is disallowed within an Ascii85 5-tuple.

Co-authored-by: Lee Cannon <[email protected]>

files:
M Lib/test/test_base64.py

diff --git a/Lib/test/test_base64.py b/Lib/test/test_base64.py
index fa03fa1d61ceab..f6171d3ed4efd7 100644
--- a/Lib/test/test_base64.py
+++ b/Lib/test/test_base64.py
@@ -586,6 +586,7 @@ def test_a85decode(self):
         eq(base64.a85decode(b'y+<Vd', foldspaces=True, adobe=False), b' '*7)
         eq(base64.a85decode(b'y+<U', foldspaces=True, adobe=False), b' '*6)
         eq(base64.a85decode(b'y+9', foldspaces=True, adobe=False), b' '*5)
+        eq(base64.a85decode(b'aaaaay', foldspaces=True), b'\xc9\x80\x0b@    ')
 
         self.check_other_types(base64.a85decode, b'GB\\6`E-ZP=Df.1GEb>',
                                b"www.python.org")
@@ -689,6 +690,8 @@ def test_a85decode_errors(self):
         self.assertRaises(ValueError, base64.a85decode, b's8W', adobe=False)
         self.assertRaises(ValueError, base64.a85decode, b's8W-', adobe=False)
         self.assertRaises(ValueError, base64.a85decode, b's8W-"', adobe=False)
+        self.assertRaises(ValueError, base64.a85decode, b'aaaay',
+                          foldspaces=True)
 
     def test_b85decode_errors(self):
         illegal = list(range(33)) + \

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to