@@ -320,16 +320,16 @@ def test_ascii85_valid(self):
320320
321321 # Test core parameter combinations
322322 params = (False , False ), (False , True ), (True , False ), (True , True )
323- for fold_spaces , wrap in params :
323+ for foldspaces , adobe in params :
324324 lines = []
325325 for rawline in rawlines :
326326 b = self .type2test (rawline )
327- a = binascii .b2a_ascii85 (b , fold_spaces = fold_spaces , wrap = wrap )
327+ a = binascii .b2a_ascii85 (b , foldspaces = foldspaces , adobe = adobe )
328328 lines .append (a )
329329 res = bytearray ()
330330 for line in lines :
331331 a = self .type2test (line )
332- b = binascii .a2b_ascii85 (a , fold_spaces = fold_spaces , wrap = wrap )
332+ b = binascii .a2b_ascii85 (a , foldspaces = foldspaces , adobe = adobe )
333333 res += b
334334 self .assertEqual (res , rawdata )
335335
@@ -344,8 +344,8 @@ def test_ascii85_valid(self):
344344 (b"<~FCfN8yg~>" , True , True , b"" , b"test " ),
345345 (b"FE;\x03 #8zFCf\x02 N8yh~>" , True , True , b"\x02 \x03 " , b"tset\x00 \x00 \x00 \x00 test " ),
346346 ]
347- for a , fold_spaces , wrap , ignore , b in params :
348- kwargs = {"fold_spaces " : fold_spaces , "wrap " : wrap , "ignore " : ignore }
347+ for a , foldspaces , adobe , ignorechars , b in params :
348+ kwargs = {"foldspaces " : foldspaces , "adobe " : adobe , "ignorechars " : ignorechars }
349349 self .assertEqual (binascii .a2b_ascii85 (self .type2test (a ), ** kwargs ), b )
350350
351351 def test_ascii85_invalid (self ):
@@ -375,13 +375,13 @@ def addnoise(line):
375375 res = bytearray ()
376376 for line in map (addnoise , lines ):
377377 a = self .type2test (line )
378- b = binascii .a2b_ascii85 (a , ignore = fillers )
378+ b = binascii .a2b_ascii85 (a , ignorechars = fillers )
379379 res += b
380380 self .assertEqual (res , self .rawdata )
381381
382382 # Test Ascii85 with only invalid characters
383383 fillers = self .type2test (fillers )
384- b = binascii .a2b_ascii85 (fillers , ignore = fillers )
384+ b = binascii .a2b_ascii85 (fillers , ignorechars = fillers )
385385 self .assertEqual (b , b"" )
386386
387387 def test_ascii85_errors (self ):
@@ -390,13 +390,13 @@ def _assertRegexTemplate(assert_regex, data, **kwargs):
390390 binascii .a2b_ascii85 (self .type2test (data ), ** kwargs )
391391
392392 def assertMissingDelimiter (data ):
393- _assertRegexTemplate (r"(?i)end with b'~>'" , data , wrap = True )
393+ _assertRegexTemplate (r"(?i)end with b'~>'" , data , adobe = True )
394394
395395 def assertOverflow (data ):
396396 _assertRegexTemplate (r"(?i)Ascii85 overflow" , data )
397397
398398 def assertInvalidSpecial (data ):
399- _assertRegexTemplate (r"(?i)'[yz]'.+5-tuple" , data , fold_spaces = True )
399+ _assertRegexTemplate (r"(?i)'[yz]'.+5-tuple" , data , foldspaces = True )
400400
401401 def assertInvalidChar (data , ** kwargs ):
402402 _assertRegexTemplate (r"(?i)Non-Ascii85 digit" , data , ** kwargs )
@@ -429,21 +429,21 @@ def assertInvalidChar(data, **kwargs):
429429
430430 # Test Ascii85 with non-ignored invalid characters
431431 assertInvalidChar (b"j\n " )
432- assertInvalidChar (b" " , ignore = b"" )
433- assertInvalidChar (b" valid\x02 until\x03 " , ignore = b"\x00 \x01 \x02 \x04 " )
434- assertInvalidChar (b"\t FCb" , ignore = b"\n " )
435- assertInvalidChar (b"xxxB\n P\t hU'D v/F+" , ignore = b" \n \t v" )
436-
437- def test_ascii85_width (self ):
438- # Test Ascii85 splitting lines by width
439- def assertEncode (a_expected , data , n , wrap = False ):
432+ assertInvalidChar (b" " , ignorechars = b"" )
433+ assertInvalidChar (b" valid\x02 until\x03 " , ignorechars = b"\x00 \x01 \x02 \x04 " )
434+ assertInvalidChar (b"\t FCb" , ignorechars = b"\n " )
435+ assertInvalidChar (b"xxxB\n P\t hU'D v/F+" , ignorechars = b" \n \t v" )
436+
437+ def test_ascii85_wrapcol (self ):
438+ # Test Ascii85 splitting lines
439+ def assertEncode (a_expected , data , n , adobe = False ):
440440 b = self .type2test (data )
441- a = binascii .b2a_ascii85 (b , wrap = wrap , width = n )
441+ a = binascii .b2a_ascii85 (b , adobe = adobe , wrapcol = n )
442442 self .assertEqual (a , a_expected )
443443
444- def assertDecode (data , b_expected , wrap = False ):
444+ def assertDecode (data , b_expected , adobe = False ):
445445 a = self .type2test (data )
446- b = binascii .a2b_ascii85 (a , wrap = wrap , ignore = b"\n " )
446+ b = binascii .a2b_ascii85 (a , adobe = adobe , ignorechars = b"\n " )
447447 self .assertEqual (b , b_expected )
448448
449449 tests = [
@@ -466,9 +466,9 @@ def assertDecode(data, b_expected, wrap=False):
466466 ]
467467 for b , n , a , a_wrap in tests :
468468 assertEncode (a , b , n )
469- assertEncode (a_wrap , b , n , wrap = True )
469+ assertEncode (a_wrap , b , n , adobe = True )
470470 assertDecode (a , b )
471- assertDecode (a_wrap , b , wrap = True )
471+ assertDecode (a_wrap , b , adobe = True )
472472
473473 def test_ascii85_pad (self ):
474474 # Test Ascii85 with encode padding
@@ -494,29 +494,29 @@ def assertShortPad(data, expected, **kwargs):
494494 assertShortPad (b"\0 " * 4 , b"z" , pad = True )
495495 assertShortPad (b"\0 " * 5 , b"zz" , pad = True )
496496 assertShortPad (b"\0 " * 6 , b"z!!!" )
497- assertShortPad (b" " * 7 , b"y+<Vd," , fold_spaces = True , pad = True )
497+ assertShortPad (b" " * 7 , b"y+<Vd," , foldspaces = True , pad = True )
498498 assertShortPad (b"\0 " * 8 , b"<~zz~>" ,
499- fold_spaces = True , wrap = True , pad = True )
499+ foldspaces = True , adobe = True , pad = True )
500500 assertShortPad (b"\0 \0 \0 \0 abcd \0 \0 " , b"<~z@:E_Wy\n z~>" ,
501- fold_spaces = True , wrap = True , width = 9 , pad = True )
501+ foldspaces = True , adobe = True , wrapcol = 9 , pad = True )
502502
503- def test_ascii85_ignore (self ):
503+ def test_ascii85_ignorechars (self ):
504504 # Test Ascii85 with ignored characters
505- def assertIgnore (data , expected , ignore = b"" , ** kwargs ):
505+ def assertIgnore (data , expected , ignorechars = b"" , ** kwargs ):
506506 data = self .type2test (data )
507- ignore = self .type2test (ignore )
507+ ignore = self .type2test (ignorechars )
508508 with self .assertRaisesRegex (binascii .Error , r"(?i)Non-Ascii85 digit" ):
509509 binascii .a2b_ascii85 (data , ** kwargs )
510- res = binascii .a2b_ascii85 (data , ignore = ignore , ** kwargs )
510+ res = binascii .a2b_ascii85 (data , ignorechars = ignorechars , ** kwargs )
511511 self .assertEqual (res , expected )
512512
513- assertIgnore (b"\n " , b"" , ignore = b"\n " )
514- assertIgnore (b"<~ ~>" , b"" , ignore = b" " , wrap = True )
515- assertIgnore (b"z|z" , b"\0 " * 8 , ignore = b"|||" ) # repeats don't matter
516- assertIgnore (b"zz!!|" , b"\0 " * 9 , ignore = b"|!z" ) # ignore only if invalid
517- assertIgnore (b"<~B P~@~>" , b"hi" , ignore = b" <~>" , wrap = True )
518- assertIgnore (b"zy}" , b"\0 \0 \0 \0 " , ignore = b"zy}" )
519- assertIgnore (b"zy}" , b"\0 \0 \0 \0 " , ignore = b"zy}" , fold_spaces = True )
513+ assertIgnore (b"\n " , b"" , ignorechars = b"\n " )
514+ assertIgnore (b"<~ ~>" , b"" , ignorechars = b" " , adobe = True )
515+ assertIgnore (b"z|z" , b"\0 " * 8 , ignorechars = b"|||" ) # repeats don't matter
516+ assertIgnore (b"zz!!|" , b"\0 " * 9 , ignorechars = b"|!z" ) # ignore only if invalid
517+ assertIgnore (b"<~B P~@~>" , b"hi" , ignorechars = b" <~>" , adobe = True )
518+ assertIgnore (b"zy}" , b"\0 \0 \0 \0 " , ignorechars = b"zy}" )
519+ assertIgnore (b"zy}" , b"\0 \0 \0 \0 " , ignorechars = b"zy}" , foldspaces = True )
520520
521521 def test_base85_valid (self ):
522522 # Test base85 with valid data
0 commit comments