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

Method test_cp20106

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

Source from the content-addressed store, hash-verified

3437 ))
3438
3439 def test_cp20106(self):
3440 self.check_encode(20106, (
3441 ('abc', 'strict', b'abc'),
3442 ('\xa7\xc4\xdf', 'strict', b'@[~'),
3443 # test error handlers
3444 ('@', 'strict', None),
3445 ('@', 'ignore', b''),
3446 ('@', 'replace', b'?'),
3447 ('\udcbf', 'surrogateescape', b'\xbf'),
3448 ('\udcbf', 'surrogatepass', None),
3449 ))
3450 self.check_decode(20106, (
3451 (b'abc', 'strict', 'abc'),
3452 (b'@[~', 'strict', '\xa7\xc4\xdf'),
3453 (b'\xe1\xfe', 'strict', 'a\xdf'),
3454 # test error handlers
3455 (b'(\xbf)', 'strict', None),
3456 (b'(\xbf)', 'ignore', '()'),
3457 (b'(\xbf)', 'replace', '(\ufffd)'),
3458 (b'(\xbf)', 'backslashreplace', '(\\xbf)'),
3459 (b'(\xbf)', 'surrogateescape', '(\udcbf)'),
3460 (b'(\xbf)', 'surrogatepass', None),
3461 ))
3462
3463 def test_cp_utf7(self):
3464 cp = 65000

Callers

nothing calls this directly

Calls 2

check_encodeMethod · 0.95
check_decodeMethod · 0.95

Tested by

no test coverage detected