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

Method test_decode_error

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

Source from the content-addressed store, hash-verified

861 u, u.encode(self.encoding))
862
863 def test_decode_error(self):
864 for data, error_handler, expected in (
865 (b'[\x80\xff]', 'ignore', '[]'),
866 (b'[\x80\xff]', 'replace', '[\ufffd\ufffd]'),
867 (b'[\x80\xff]', 'surrogateescape', '[\udc80\udcff]'),
868 (b'[\x80\xff]', 'backslashreplace', '[\\x80\\xff]'),
869 ):
870 with self.subTest(data=data, error_handler=error_handler,
871 expected=expected):
872 self.assertEqual(data.decode(self.encoding, error_handler),
873 expected)
874
875 def test_lone_surrogates(self):
876 super().test_lone_surrogates()

Callers

nothing calls this directly

Calls 3

subTestMethod · 0.45
assertEqualMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected