File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1
1
import unittest
2
2
import base64
3
3
import binascii
4
+ import hashlib
5
+ import string
4
6
import os
5
7
from array import array
6
8
from test .support import os_helper
@@ -545,6 +547,17 @@ def test_b85encode(self):
545
547
self .check_other_types (base64 .b85encode , b"www.python.org" ,
546
548
b'cXxL#aCvlSZ*DGca%T' )
547
549
550
+ def test_b85encode_large_input (self ):
551
+ # more than 512 bytes (+ padding)
552
+ large_input = string .ascii_letters .encode () * 12 + b"foo"
553
+ result = base64 .b85encode (large_input )
554
+
555
+ # since the result is to large to fit inside a test,
556
+ # use a hash method to validate the test
557
+ self .assertEqual (len (result ), 784 )
558
+ self .assertEqual (hashlib .md5 (result ).hexdigest (),
559
+ "0537cfca1aed7495e80d3328e9ef3008" )
560
+
548
561
def test_a85decode (self ):
549
562
eq = self .assertEqual
550
563
You can’t perform that action at this time.
0 commit comments