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

Method test_lone_surrogates

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

Source from the content-addressed store, hash-verified

873 expected)
874
875 def test_lone_surrogates(self):
876 super().test_lone_surrogates()
877 # not sure if this is making sense for
878 # UTF-16 and UTF-32
879 self.assertEqual("[\uDC80]".encode(self.encoding, "surrogateescape"),
880 self.BOM + b'[\x80]')
881
882 with self.assertRaises(UnicodeEncodeError) as cm:
883 "[\uDC80\uD800\uDFFF]".encode(self.encoding, "surrogateescape")
884 exc = cm.exception
885 self.assertEqual(exc.object[exc.start:exc.end], '\uD800\uDFFF')
886
887 def test_surrogatepass_handler(self):
888 self.assertEqual("abc\ud800def".encode(self.encoding, "surrogatepass"),

Callers

nothing calls this directly

Calls 5

superClass · 0.85
test_lone_surrogatesMethod · 0.45
assertEqualMethod · 0.45
encodeMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected