MCPcopy Index your code
hub / github.com/python/cpython / test_cp708

Method test_cp708

Lib/test/test_codecs.py:3410–3437  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3408 ))
3409
3410 def test_cp708(self):
3411 self.check_encode(708, (
3412 ('abc2%', 'strict', b'abc2%'),
3413 ('\u060c\u0621\u064a', 'strict', b'\xac\xc1\xea'),
3414 ('\u2562\xe7\xa0', 'strict', b'\x86\x87\xff'),
3415 ('\x9a\x9f', 'strict', b'\x9a\x9f'),
3416 ('\u256b', 'strict', b'\xc0'),
3417 # test error handlers
3418 ('[\u0662]', 'strict', None),
3419 ('[\u0662]', 'ignore', b'[]'),
3420 ('[\u0662]', 'replace', b'[?]'),
3421 ('\udca0', 'surrogateescape', b'\xa0'),
3422 ('\udca0', 'surrogatepass', None),
3423 ))
3424 self.check_decode(708, (
3425 (b'abc2%', 'strict', 'abc2%'),
3426 (b'\xac\xc1\xea', 'strict', '\u060c\u0621\u064a'),
3427 (b'\x86\x87\xff', 'strict', '\u2562\xe7\xa0'),
3428 (b'\x9a\x9f', 'strict', '\x9a\x9f'),
3429 (b'\xc0', 'strict', '\u256b'),
3430 # test error handlers
3431 (b'\xa0', 'strict', None),
3432 (b'[\xa0]', 'ignore', '[]'),
3433 (b'[\xa0]', 'replace', '[\ufffd]'),
3434 (b'[\xa0]', 'backslashreplace', '[\\xa0]'),
3435 (b'[\xa0]', 'surrogateescape', '[\udca0]'),
3436 (b'[\xa0]', 'surrogatepass', None),
3437 ))
3438
3439 def test_cp20106(self):
3440 self.check_encode(20106, (

Callers

nothing calls this directly

Calls 2

check_encodeMethod · 0.95
check_decodeMethod · 0.95

Tested by

no test coverage detected