@@ -25,17 +25,23 @@ class BinASCIITest(unittest.TestCase):
25
25
def setUp (self ):
26
26
self .data = self .type2test (self .rawdata )
27
27
28
+ # TODO: RUSTPYTHON
29
+ @unittest .expectedFailure
28
30
def test_exceptions (self ):
29
31
# Check module exceptions
30
32
self .assertTrue (issubclass (binascii .Error , Exception ))
31
33
self .assertTrue (issubclass (binascii .Incomplete , Exception ))
32
34
35
+ # TODO: RUSTPYTHON
36
+ @unittest .expectedFailure
33
37
def test_functions (self ):
34
38
# Check presence of all functions
35
39
for name in all_functions :
36
40
self .assertTrue (hasattr (getattr (binascii , name ), '__call__' ))
37
41
self .assertRaises (TypeError , getattr (binascii , name ))
38
42
43
+ # TODO: RUSTPYTHON
44
+ @unittest .expectedFailure
39
45
def test_returned_value (self ):
40
46
# Limit to the minimum of all limits (b2a_uu)
41
47
MAX_ALL = 45
@@ -74,6 +80,8 @@ def test_base64valid(self):
74
80
res += b
75
81
self .assertEqual (res , self .rawdata )
76
82
83
+ # TODO: RUSTPYTHON
84
+ @unittest .expectedFailure
77
85
def test_base64invalid (self ):
78
86
# Test base64 with random invalid characters sprinkled throughout
79
87
# (This requires a new version of binascii.)
@@ -111,6 +119,8 @@ def addnoise(line):
111
119
# empty strings. TBD: shouldn't it raise an exception instead ?
112
120
self .assertEqual (binascii .a2b_base64 (self .type2test (fillers )), b'' )
113
121
122
+ # TODO: RUSTPYTHON
123
+ @unittest .expectedFailure
114
124
def test_base64errors (self ):
115
125
# Test base64 with invalid padding
116
126
def assertIncorrectPadding (data ):
@@ -142,6 +152,8 @@ def assertInvalidLength(data):
142
152
assertInvalidLength (b'a' * (4 * 87 + 1 ))
143
153
assertInvalidLength (b'A\t B\n C ??DE' ) # only 5 valid characters
144
154
155
+ # TODO: RUSTPYTHON
156
+ @unittest .expectedFailure
145
157
def test_uu (self ):
146
158
MAX_UU = 45
147
159
for backtick in (True , False ):
@@ -179,6 +191,8 @@ def test_uu(self):
179
191
with self .assertRaises (TypeError ):
180
192
binascii .b2a_uu (b"" , True )
181
193
194
+ # TODO: RUSTPYTHON
195
+ @unittest .expectedFailure
182
196
def test_crc_hqx (self ):
183
197
crc = binascii .crc_hqx (self .type2test (b"Test the CRC-32 of" ), 0 )
184
198
crc = binascii .crc_hqx (self .type2test (b" this string." ), crc )
@@ -198,6 +212,8 @@ def test_crc32(self):
198
212
199
213
self .assertRaises (TypeError , binascii .crc32 )
200
214
215
+ # TODO: RUSTPYTHON
216
+ @unittest .expectedFailure
201
217
def test_hqx (self ):
202
218
# Perform binhex4 style RLE-compression
203
219
# Then calculate the hexbin4 binary-to-ASCII translation
@@ -208,6 +224,8 @@ def test_hqx(self):
208
224
res = binascii .rledecode_hqx (b )
209
225
self .assertEqual (res , self .rawdata )
210
226
227
+ # TODO: RUSTPYTHON
228
+ @unittest .expectedFailure
211
229
def test_rle (self ):
212
230
# test repetition with a repetition longer than the limit of 255
213
231
data = (b'a' * 100 + b'b' + b'c' * 300 )
@@ -222,6 +240,8 @@ def test_rle(self):
222
240
decoded = binascii .rledecode_hqx (encoded )
223
241
self .assertEqual (decoded , data )
224
242
243
+ # TODO: RUSTPYTHON
244
+ @unittest .expectedFailure
225
245
def test_hex (self ):
226
246
# test hexlification
227
247
s = b'{s\005 \000 \000 \000 worldi\002 \000 \000 \000 s\005 \000 \000 \000 helloi\001 \000 \000 \000 0'
@@ -240,6 +260,8 @@ def test_hex(self):
240
260
self .assertEqual (binascii .hexlify (self .type2test (s )), t )
241
261
self .assertEqual (binascii .unhexlify (self .type2test (t )), u )
242
262
263
+ # TODO: RUSTPYTHON
264
+ @unittest .expectedFailure
243
265
def test_hex_separator (self ):
244
266
"""Test that hexlify and b2a_hex are binary versions of bytes.hex."""
245
267
# Logic of separators is tested in test_bytes.py. This checks that
@@ -252,6 +274,8 @@ def test_hex_separator(self):
252
274
expected1 = s .hex (':' ).encode ('ascii' )
253
275
self .assertEqual (binascii .b2a_hex (self .type2test (s ), ':' ), expected1 )
254
276
277
+ # TODO: RUSTPYTHON
278
+ @unittest .expectedFailure
255
279
def test_qp (self ):
256
280
type2test = self .type2test
257
281
a2b_qp = binascii .a2b_qp
@@ -354,6 +378,8 @@ def test_qp(self):
354
378
self .assertEqual (b2a_qp (type2test (b'a.\n ' )), b'a.\n ' )
355
379
self .assertEqual (b2a_qp (type2test (b'.a' )[:- 1 ]), b'=2E' )
356
380
381
+ # TODO: RUSTPYTHON
382
+ @unittest .expectedFailure
357
383
def test_empty_string (self ):
358
384
# A test for SF bug #1022953. Make sure SystemError is not raised.
359
385
empty = self .type2test (b'' )
@@ -368,6 +394,8 @@ def test_empty_string(self):
368
394
except Exception as err :
369
395
self .fail ("{}({!r}) raises {!r}" .format (func , empty , err ))
370
396
397
+ # TODO: RUSTPYTHON
398
+ @unittest .expectedFailure
371
399
def test_unicode_b2a (self ):
372
400
# Unicode strings are not accepted by b2a_* functions.
373
401
for func in set (all_functions ) - set (a2b_functions ) | {'rledecode_hqx' }:
@@ -378,6 +406,8 @@ def test_unicode_b2a(self):
378
406
# crc_hqx needs 2 arguments
379
407
self .assertRaises (TypeError , binascii .crc_hqx , "test" , 0 )
380
408
409
+ # TODO: RUSTPYTHON
410
+ @unittest .expectedFailure
381
411
def test_unicode_a2b (self ):
382
412
# Unicode strings are accepted by a2b_* functions.
383
413
MAX_ALL = 45
@@ -421,6 +451,16 @@ class ArrayBinASCIITest(BinASCIITest):
421
451
def type2test (self , s ):
422
452
return array .array ('B' , list (s ))
423
453
454
+ # TODO: RUSTPYTHON
455
+ @unittest .expectedFailure
456
+ def test_crc32 (self ):
457
+ super ().test_crc32 ()
458
+
459
+ # TODO: RUSTPYTHON
460
+ @unittest .expectedFailure
461
+ def test_base64valid (self ):
462
+ super ().test_base64valid ()
463
+
424
464
425
465
class BytearrayBinASCIITest (BinASCIITest ):
426
466
type2test = bytearray
@@ -429,6 +469,15 @@ class BytearrayBinASCIITest(BinASCIITest):
429
469
class MemoryviewBinASCIITest (BinASCIITest ):
430
470
type2test = memoryview
431
471
472
+ # TODO: RUSTPYTHON
473
+ @unittest .expectedFailure
474
+ def test_crc32 (self ):
475
+ super ().test_crc32 ()
476
+
477
+ # TODO: RUSTPYTHON
478
+ @unittest .expectedFailure
479
+ def test_base64valid (self ):
480
+ super ().test_base64valid ()
432
481
433
482
if __name__ == "__main__" :
434
483
unittest .main ()
0 commit comments