(self)
| 9 | |
| 10 | class TestProperty(vtkTesting.vtkTest): |
| 11 | def testVtkObject(self): |
| 12 | i = vtkImageData() |
| 13 | |
| 14 | i.dimensions = (2, 2, 3) |
| 15 | self.assertTupleEqual(i.dimensions, (2, 2, 3)) |
| 16 | self.assertTupleEqual(i.GetDimensions(), (2, 2, 3)) |
| 17 | |
| 18 | i.SetDimensions(2, 2, 4) |
| 19 | self.assertTupleEqual(i.dimensions, (2, 2, 4)) |
| 20 | |
| 21 | # check that i.number_of_points = 2 fails because number_of_points is a read-only property. |
| 22 | with self.assertRaisesRegex(AttributeError, "attribute 'number_of_points' of 'vtkmodules.vtkCommonDataModel.vtkCartesianGrid' objects is not writable"): |
| 23 | i.number_of_points = 2 |
| 24 | |
| 25 | i.debug = True |
| 26 | self.assertEqual(i.debug, True) |
| 27 | self.assertEqual(i.GetDebug(), True) |
| 28 | |
| 29 | i.SetDebug(False) |
| 30 | self.assertEqual(i.debug, False) |
| 31 | |
| 32 | def testSpecialObject(self): |
| 33 | b = vtkBoundingBox() |
nothing calls this directly
no test coverage detected