(self)
| 763 | ) |
| 764 | |
| 765 | def test_errors(self): |
| 766 | tests = [ |
| 767 | (b'\xff', '\ufffd'), |
| 768 | (b'A\x00Z', 'A\ufffd'), |
| 769 | (b'A\x00B\x00C\x00D\x00Z', 'ABCD\ufffd'), |
| 770 | (b'\x00\xd8', '\ufffd'), |
| 771 | (b'\x00\xd8A', '\ufffd'), |
| 772 | (b'\x00\xd8A\x00', '\ufffdA'), |
| 773 | (b'\x00\xdcA\x00', '\ufffdA'), |
| 774 | ] |
| 775 | for raw, expected in tests: |
| 776 | self.assertRaises(UnicodeDecodeError, codecs.utf_16_le_decode, |
| 777 | raw, 'strict', True) |
| 778 | self.assertEqual(raw.decode('utf-16le', 'replace'), expected) |
| 779 | |
| 780 | def test_nonbmp(self): |
| 781 | self.assertEqual("\U00010203".encode(self.encoding), |
nothing calls this directly
no test coverage detected