(self)
| 3368 | |
| 3369 | @unittest.expectedFailure # TODO: RUSTPYTHON |
| 3370 | def test_cp932(self): |
| 3371 | self.check_encode(932, ( |
| 3372 | ('abc', 'strict', b'abc'), |
| 3373 | ('\uff44\u9a3e', 'strict', b'\x82\x84\xe9\x80'), |
| 3374 | ('\uf8f3', 'strict', b'\xff'), |
| 3375 | # test error handlers |
| 3376 | ('\xff', 'strict', None), |
| 3377 | ('[\xff]', 'ignore', b'[]'), |
| 3378 | ('[\xff]', 'replace', b'[y]', b'[?]'), |
| 3379 | ('[\u20ac]', 'replace', b'[?]'), |
| 3380 | ('[\xff]', 'backslashreplace', b'[\\xff]'), |
| 3381 | ('[\xff]', 'namereplace', |
| 3382 | b'[\\N{LATIN SMALL LETTER Y WITH DIAERESIS}]'), |
| 3383 | ('[\xff]', 'xmlcharrefreplace', b'[ÿ]'), |
| 3384 | ('\udcff', 'strict', None), |
| 3385 | ('[\udcff]', 'surrogateescape', b'[\xff]'), |
| 3386 | ('[\udcff]', 'surrogatepass', None), |
| 3387 | )) |
| 3388 | self.check_decode(932, ( |
| 3389 | (b'abc', 'strict', 'abc'), |
| 3390 | (b'\x82\x84\xe9\x80', 'strict', '\uff44\u9a3e'), |
| 3391 | # invalid bytes |
| 3392 | (b'[\xff]', 'strict', None, '[\uf8f3]'), |
| 3393 | (b'[\xff]', 'ignore', '[]', '[\uf8f3]'), |
| 3394 | (b'[\xff]', 'replace', '[\ufffd]', '[\uf8f3]'), |
| 3395 | (b'[\xff]', 'backslashreplace', '[\\xff]', '[\uf8f3]'), |
| 3396 | (b'[\xff]', 'surrogateescape', '[\udcff]', '[\uf8f3]'), |
| 3397 | (b'[\xff]', 'surrogatepass', None, '[\uf8f3]'), |
| 3398 | (b'\x81\x00abc', 'strict', None), |
| 3399 | (b'\x81\x00abc', 'ignore', '\x00abc'), |
| 3400 | (b'\x81\x00abc', 'replace', '\ufffd\x00abc'), |
| 3401 | (b'\x81\x00abc', 'backslashreplace', '\\x81\x00abc'), |
| 3402 | )) |
| 3403 | |
| 3404 | def test_cp1252(self): |
| 3405 | self.check_encode(1252, ( |
nothing calls this directly
no test coverage detected