MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_decode_error

Method test_decode_error

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

subTestMethod · 0.80
assertEqualMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected