Test the special case of the char array.
(self)
| 83 | self.assertEqual(tp, (10, 7, 4, 85, 8, 2)) |
| 84 | |
| 85 | def testCharArray(self): |
| 86 | """Test the special case of the char array.""" |
| 87 | # bit array is actually stored as a byte array |
| 88 | a = vtkCharArray() |
| 89 | a.SetNumberOfComponents(5) |
| 90 | a.InsertNextTypedTuple("hello") |
| 91 | a.InsertNextTypedTuple("world") |
| 92 | m = memoryview(a) |
| 93 | self.assertEqual(m.format, 'c') |
| 94 | self.assertEqual(m.itemsize, 1) |
| 95 | self.assertEqual(m.shape, (2, 5)) |
| 96 | self.assertEqual(m.strides, (5, 1)) |
| 97 | self.assertEqual(m.ndim, 2) |
| 98 | # test the contents of the memoryview |
| 99 | self.assertEqual(m.tobytes(), b"helloworld") |
| 100 | |
| 101 | def testBitArray(self): |
| 102 | """Test the special case of the bit array.""" |
nothing calls this directly
no test coverage detected