(self)
| 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"), |
nothing calls this directly
no test coverage detected