Test the special case of the bit array.
(self)
| 99 | self.assertEqual(m.tobytes(), b"helloworld") |
| 100 | |
| 101 | def testBitArray(self): |
| 102 | """Test the special case of the bit array.""" |
| 103 | # bit array is actually stored as a byte array |
| 104 | a = vtkBitArray() |
| 105 | a.InsertNextValue(0) |
| 106 | a.InsertNextValue(1) |
| 107 | a.InsertNextValue(1) |
| 108 | a.InsertNextValue(0) |
| 109 | a.InsertNextValue(1) |
| 110 | m = memoryview(a) |
| 111 | self.assertEqual(m.format, 'B') |
| 112 | self.assertEqual(m.itemsize, 1) |
| 113 | self.assertEqual(m.shape, (1,)) |
| 114 | # test the contents of the memoryview |
| 115 | self.assertEqual(ord(m.tobytes()) & 0xF8, 0x68) |
| 116 | |
| 117 | def testBufferShared(self): |
| 118 | """Test the special buffer_shared() check that VTK provides.""" |
nothing calls this directly
no test coverage detected