MCPcopy Create free account
hub / github.com/Kitware/VTK / testVtkObject

Method testVtkObject

Wrapping/Python/Testing/Python/TestProperty.py:11–30  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

9
10class 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()

Callers

nothing calls this directly

Calls 5

GetDebugMethod · 0.80
vtkImageDataClass · 0.50
GetDimensionsMethod · 0.45
SetDimensionsMethod · 0.45
SetDebugMethod · 0.45

Tested by

no test coverage detected