Skip to content

Commit c160d81

Browse files
committed
fix
1 parent 097ad74 commit c160d81

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

Lib/test/test_codecs.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ def test_bug1098990_b(self):
390390

391391
ill_formed_sequence_replace = "\ufffd"
392392

393+
@unittest.expectedFailure # TODO: RUSTPYTHON
393394
def test_lone_surrogates(self):
394395
self.assertRaises(UnicodeEncodeError, "\ud800".encode, self.encoding)
395396
self.assertEqual("[\uDC80]".encode(self.encoding, "backslashreplace"),
@@ -520,6 +521,7 @@ def test_partial(self):
520521
]
521522
)
522523

524+
@unittest.expectedFailure # TODO: RUSTPYTHON
523525
def test_handlers(self):
524526
self.assertEqual(('\ufffd', 1),
525527
codecs.utf_32_decode(b'\x01', 'replace', True))
@@ -811,6 +813,7 @@ def test_partial(self):
811813
]
812814
)
813815

816+
@unittest.expectedFailure # TODO: RUSTPYTHON
814817
def test_errors(self):
815818
tests = [
816819
(b'\xff', '\ufffd'),
@@ -861,6 +864,7 @@ def test_partial(self):
861864
]
862865
)
863866

867+
@unittest.expectedFailure # TODO: RUSTPYTHON
864868
def test_errors(self):
865869
tests = [
866870
(b'\xff', '\ufffd'),
@@ -932,6 +936,7 @@ def test_decode_error(self):
932936
self.assertEqual(data.decode(self.encoding, error_handler),
933937
expected)
934938

939+
@unittest.expectedFailure # TODO: RUSTPYTHON
935940
def test_lone_surrogates(self):
936941
super().test_lone_surrogates()
937942
# not sure if this is making sense for
@@ -984,6 +989,7 @@ def test_incremental_errors(self):
984989
class UTF7Test(ReadTest, unittest.TestCase):
985990
encoding = "utf-7"
986991

992+
@unittest.expectedFailure # TODO: RUSTPYTHON
987993
def test_ascii(self):
988994
# Set D (directly encoded characters)
989995
set_d = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'
@@ -1050,6 +1056,7 @@ def test_partial(self):
10501056
]
10511057
)
10521058

1059+
@unittest.expectedFailure # TODO: RUSTPYTHON
10531060
def test_errors(self):
10541061
tests = [
10551062
(b'\xffb', '\ufffdb'),
@@ -1080,6 +1087,7 @@ def test_errors(self):
10801087
raw, 'strict', True)
10811088
self.assertEqual(raw.decode('utf-7', 'replace'), expected)
10821089

1090+
@unittest.expectedFailure # TODO: RUSTPYTHON
10831091
def test_nonbmp(self):
10841092
self.assertEqual('\U000104A0'.encode(self.encoding), b'+2AHcoA-')
10851093
self.assertEqual('\ud801\udca0'.encode(self.encoding), b'+2AHcoA-')
@@ -1095,6 +1103,7 @@ def test_nonbmp(self):
10951103
self.assertEqual(b'+IKwgrNgB3KA'.decode(self.encoding),
10961104
'\u20ac\u20ac\U000104A0')
10971105

1106+
@unittest.expectedFailure # TODO: RUSTPYTHON
10981107
def test_lone_surrogates(self):
10991108
tests = [
11001109
(b'a+2AE-b', 'a\ud801b'),
@@ -1115,18 +1124,19 @@ def test_lone_surrogates(self):
11151124
with self.subTest(raw=raw):
11161125
self.assertEqual(raw.decode('utf-7', 'replace'), expected)
11171126

1118-
@unittest.expectedFailure # TODO: RUSTPYTHON; TypeError: expected at least 5 arguments, got 1
11191127
def test_readline(self):
11201128
return super().test_readline()
11211129

1122-
@unittest.expectedFailure # TODO: RUSTPYTHON; TypeError: utf_7_decode() takes from 1 to 2 positional arguments but 3 were given
1130+
@unittest.expectedFailure # TODO: RUSTPYTHON
1131+
def test_bug1175396(self):
1132+
return super().test_bug1175396()
1133+
1134+
@unittest.expectedFailure # TODO: RUSTPYTHON
11231135
def test_incremental_surrogatepass(self):
11241136
return super().test_incremental_surrogatepass()
11251137

11261138

11271139

1128-
1129-
11301140
class UTF16ExTest(unittest.TestCase):
11311141

11321142
def test_errors(self):
@@ -3409,6 +3419,7 @@ def test_invalid_code_page(self):
34093419
self.assertRaises(OSError, codecs.code_page_encode, 123, 'a')
34103420
self.assertRaises(OSError, codecs.code_page_decode, 123, b'a')
34113421

3422+
@unittest.expectedFailure # TODO: RUSTPYTHON
34123423
def test_code_page_name(self):
34133424
self.assertRaisesRegex(UnicodeEncodeError, 'cp932',
34143425
codecs.code_page_encode, 932, '\xff')
@@ -3510,6 +3521,7 @@ def test_cp932(self):
35103521
(b'\x81\x00abc', 'backslashreplace', '\\x81\x00abc'),
35113522
))
35123523

3524+
@unittest.expectedFailure # TODO: RUSTPYTHON
35133525
def test_cp1252(self):
35143526
self.check_encode(1252, (
35153527
('abc', 'strict', b'abc'),
@@ -3583,7 +3595,7 @@ def test_cp20106(self):
35833595
(b'(\xbf)', 'surrogatepass', None),
35843596
))
35853597

3586-
@unittest.expectedFailure # TODO: RUSTPYTHON # TODO: RUSTPYTHON
3598+
@unittest.expectedFailure # TODO: RUSTPYTHON
35873599
def test_cp_utf7(self):
35883600
cp = 65000
35893601
self.check_encode(cp, (
@@ -3604,6 +3616,7 @@ def test_cp_utf7(self):
36043616
(b'[\xff]', 'strict', '[\xff]'),
36053617
))
36063618

3619+
@unittest.expectedFailure # TODO: RUSTPYTHON
36073620
def test_multibyte_encoding(self):
36083621
self.check_decode(932, (
36093622
(b'\x84\xe9\x80', 'ignore', '\u9a3e'),
@@ -3637,6 +3650,7 @@ def test_code_page_decode_flags(self):
36373650
self.assertEqual(codecs.code_page_decode(42, b'abc'),
36383651
('\uf061\uf062\uf063', 3))
36393652

3653+
@unittest.expectedFailure # TODO: RUSTPYTHON
36403654
def test_incremental(self):
36413655
decoded = codecs.code_page_decode(932, b'\x82', 'strict', False)
36423656
self.assertEqual(decoded, ('', 0))

0 commit comments

Comments
 (0)