(self)
| 1223 | minitemsize = sizeof_wchar |
| 1224 | |
| 1225 | def test_unicode(self): |
| 1226 | self.assertRaises(TypeError, array.array, 'b', 'foo') |
| 1227 | |
| 1228 | a = array.array(self.typecode, '\xa0\xc2\u1234') |
| 1229 | a.fromunicode(' ') |
| 1230 | a.fromunicode('') |
| 1231 | a.fromunicode('') |
| 1232 | a.fromunicode('\x11abc\xff\u1234') |
| 1233 | s = a.tounicode() |
| 1234 | self.assertEqual(s, '\xa0\xc2\u1234 \x11abc\xff\u1234') |
| 1235 | self.assertEqual(a.itemsize, self.minitemsize) |
| 1236 | |
| 1237 | s = '\x00="\'a\\b\x80\xff\u0000\u0001\u1234' |
| 1238 | a = array.array(self.typecode, s) |
| 1239 | self.assertEqual( |
| 1240 | repr(a), |
| 1241 | f"array('{self.typecode}', '\\x00=\"\\'a\\\\b\\x80\xff\\x00\\x01\u1234')") |
| 1242 | |
| 1243 | self.assertRaises(TypeError, a.fromunicode) |
| 1244 | |
| 1245 | def test_issue17223(self): |
| 1246 | if self.typecode == 'u' and sizeof_wchar == 2: |
nothing calls this directly
no test coverage detected