(self)
| 807 | ) |
| 808 | |
| 809 | def test_errors(self): |
| 810 | tests = [ |
| 811 | (b'\xff', '\ufffd'), |
| 812 | (b'\x00A\xff', 'A\ufffd'), |
| 813 | (b'\x00A\x00B\x00C\x00DZ', 'ABCD\ufffd'), |
| 814 | (b'\xd8\x00', '\ufffd'), |
| 815 | (b'\xd8\x00\xdc', '\ufffd'), |
| 816 | (b'\xd8\x00\x00A', '\ufffdA'), |
| 817 | (b'\xdc\x00\x00A', '\ufffdA'), |
| 818 | ] |
| 819 | for raw, expected in tests: |
| 820 | self.assertRaises(UnicodeDecodeError, codecs.utf_16_be_decode, |
| 821 | raw, 'strict', True) |
| 822 | self.assertEqual(raw.decode('utf-16be', 'replace'), expected) |
| 823 | |
| 824 | def test_nonbmp(self): |
| 825 | self.assertEqual("\U00010203".encode(self.encoding), |
nothing calls this directly
no test coverage detected