Skip to content

Commit ed1a57f

Browse files
committed
Mark erroring/failing tests
1 parent 56ca19c commit ed1a57f

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

Lib/test/test_binascii.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,23 @@ class BinASCIITest(unittest.TestCase):
2525
def setUp(self):
2626
self.data = self.type2test(self.rawdata)
2727

28+
# TODO: RUSTPYTHON
29+
@unittest.expectedFailure
2830
def test_exceptions(self):
2931
# Check module exceptions
3032
self.assertTrue(issubclass(binascii.Error, Exception))
3133
self.assertTrue(issubclass(binascii.Incomplete, Exception))
3234

35+
# TODO: RUSTPYTHON
36+
@unittest.expectedFailure
3337
def test_functions(self):
3438
# Check presence of all functions
3539
for name in all_functions:
3640
self.assertTrue(hasattr(getattr(binascii, name), '__call__'))
3741
self.assertRaises(TypeError, getattr(binascii, name))
3842

43+
# TODO: RUSTPYTHON
44+
@unittest.expectedFailure
3945
def test_returned_value(self):
4046
# Limit to the minimum of all limits (b2a_uu)
4147
MAX_ALL = 45
@@ -74,6 +80,8 @@ def test_base64valid(self):
7480
res += b
7581
self.assertEqual(res, self.rawdata)
7682

83+
# TODO: RUSTPYTHON
84+
@unittest.expectedFailure
7785
def test_base64invalid(self):
7886
# Test base64 with random invalid characters sprinkled throughout
7987
# (This requires a new version of binascii.)
@@ -111,6 +119,8 @@ def addnoise(line):
111119
# empty strings. TBD: shouldn't it raise an exception instead ?
112120
self.assertEqual(binascii.a2b_base64(self.type2test(fillers)), b'')
113121

122+
# TODO: RUSTPYTHON
123+
@unittest.expectedFailure
114124
def test_base64errors(self):
115125
# Test base64 with invalid padding
116126
def assertIncorrectPadding(data):
@@ -142,6 +152,8 @@ def assertInvalidLength(data):
142152
assertInvalidLength(b'a' * (4 * 87 + 1))
143153
assertInvalidLength(b'A\tB\nC ??DE') # only 5 valid characters
144154

155+
# TODO: RUSTPYTHON
156+
@unittest.expectedFailure
145157
def test_uu(self):
146158
MAX_UU = 45
147159
for backtick in (True, False):
@@ -179,6 +191,8 @@ def test_uu(self):
179191
with self.assertRaises(TypeError):
180192
binascii.b2a_uu(b"", True)
181193

194+
# TODO: RUSTPYTHON
195+
@unittest.expectedFailure
182196
def test_crc_hqx(self):
183197
crc = binascii.crc_hqx(self.type2test(b"Test the CRC-32 of"), 0)
184198
crc = binascii.crc_hqx(self.type2test(b" this string."), crc)
@@ -198,6 +212,8 @@ def test_crc32(self):
198212

199213
self.assertRaises(TypeError, binascii.crc32)
200214

215+
# TODO: RUSTPYTHON
216+
@unittest.expectedFailure
201217
def test_hqx(self):
202218
# Perform binhex4 style RLE-compression
203219
# Then calculate the hexbin4 binary-to-ASCII translation
@@ -208,6 +224,8 @@ def test_hqx(self):
208224
res = binascii.rledecode_hqx(b)
209225
self.assertEqual(res, self.rawdata)
210226

227+
# TODO: RUSTPYTHON
228+
@unittest.expectedFailure
211229
def test_rle(self):
212230
# test repetition with a repetition longer than the limit of 255
213231
data = (b'a' * 100 + b'b' + b'c' * 300)
@@ -222,6 +240,8 @@ def test_rle(self):
222240
decoded = binascii.rledecode_hqx(encoded)
223241
self.assertEqual(decoded, data)
224242

243+
# TODO: RUSTPYTHON
244+
@unittest.expectedFailure
225245
def test_hex(self):
226246
# test hexlification
227247
s = b'{s\005\000\000\000worldi\002\000\000\000s\005\000\000\000helloi\001\000\000\0000'
@@ -240,6 +260,8 @@ def test_hex(self):
240260
self.assertEqual(binascii.hexlify(self.type2test(s)), t)
241261
self.assertEqual(binascii.unhexlify(self.type2test(t)), u)
242262

263+
# TODO: RUSTPYTHON
264+
@unittest.expectedFailure
243265
def test_hex_separator(self):
244266
"""Test that hexlify and b2a_hex are binary versions of bytes.hex."""
245267
# Logic of separators is tested in test_bytes.py. This checks that
@@ -252,6 +274,8 @@ def test_hex_separator(self):
252274
expected1 = s.hex(':').encode('ascii')
253275
self.assertEqual(binascii.b2a_hex(self.type2test(s), ':'), expected1)
254276

277+
# TODO: RUSTPYTHON
278+
@unittest.expectedFailure
255279
def test_qp(self):
256280
type2test = self.type2test
257281
a2b_qp = binascii.a2b_qp
@@ -354,6 +378,8 @@ def test_qp(self):
354378
self.assertEqual(b2a_qp(type2test(b'a.\n')), b'a.\n')
355379
self.assertEqual(b2a_qp(type2test(b'.a')[:-1]), b'=2E')
356380

381+
# TODO: RUSTPYTHON
382+
@unittest.expectedFailure
357383
def test_empty_string(self):
358384
# A test for SF bug #1022953. Make sure SystemError is not raised.
359385
empty = self.type2test(b'')
@@ -368,6 +394,8 @@ def test_empty_string(self):
368394
except Exception as err:
369395
self.fail("{}({!r}) raises {!r}".format(func, empty, err))
370396

397+
# TODO: RUSTPYTHON
398+
@unittest.expectedFailure
371399
def test_unicode_b2a(self):
372400
# Unicode strings are not accepted by b2a_* functions.
373401
for func in set(all_functions) - set(a2b_functions) | {'rledecode_hqx'}:
@@ -378,6 +406,8 @@ def test_unicode_b2a(self):
378406
# crc_hqx needs 2 arguments
379407
self.assertRaises(TypeError, binascii.crc_hqx, "test", 0)
380408

409+
# TODO: RUSTPYTHON
410+
@unittest.expectedFailure
381411
def test_unicode_a2b(self):
382412
# Unicode strings are accepted by a2b_* functions.
383413
MAX_ALL = 45
@@ -421,6 +451,16 @@ class ArrayBinASCIITest(BinASCIITest):
421451
def type2test(self, s):
422452
return array.array('B', list(s))
423453

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+
424464

425465
class BytearrayBinASCIITest(BinASCIITest):
426466
type2test = bytearray
@@ -429,6 +469,15 @@ class BytearrayBinASCIITest(BinASCIITest):
429469
class MemoryviewBinASCIITest(BinASCIITest):
430470
type2test = memoryview
431471

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()
432481

433482
if __name__ == "__main__":
434483
unittest.main()

0 commit comments

Comments
 (0)