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

Method test_cp_utf7

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

Source from the content-addressed store, hash-verified

3461 ))
3462
3463 def test_cp_utf7(self):
3464 cp = 65000
3465 self.check_encode(cp, (
3466 ('abc', 'strict', b'abc'),
3467 ('\xe9\u20ac', 'strict', b'+AOkgrA-'),
3468 ('\U0010ffff', 'strict', b'+2//f/w-'),
3469 ('\udc80', 'strict', b'+3IA-'),
3470 ('\ufffd', 'strict', b'+//0-'),
3471 ))
3472 self.check_decode(cp, (
3473 (b'abc', 'strict', 'abc'),
3474 (b'+AOkgrA-', 'strict', '\xe9\u20ac'),
3475 (b'+2//f/w-', 'strict', '\U0010ffff'),
3476 (b'+3IA-', 'strict', '\udc80'),
3477 (b'+//0-', 'strict', '\ufffd'),
3478 # invalid bytes
3479 (b'[+/]', 'strict', '[]'),
3480 (b'[\xff]', 'strict', '[\xff]'),
3481 ))
3482
3483 def test_multibyte_encoding(self):
3484 self.check_decode(932, (

Callers

nothing calls this directly

Calls 2

check_encodeMethod · 0.95
check_decodeMethod · 0.95

Tested by

no test coverage detected