Test overloaded methods
(self)
| 33 | class TestOverloads(Testing.vtkTest): |
| 34 | |
| 35 | def testMethods(self): |
| 36 | """Test overloaded methods""" |
| 37 | # single-argument method vtkTransform::SetMatrix() |
| 38 | t = vtkTransform() |
| 39 | m = vtkMatrix4x4() |
| 40 | m.SetElement(0, 0, 2) |
| 41 | t.SetMatrix(m) |
| 42 | self.assertEqual(t.GetMatrix().GetElement(0, 0), 2) |
| 43 | t.SetMatrix([0,1,0,0, 1,0,0,0, 0,0,-1,0, 0,0,0,1]) |
| 44 | self.assertEqual(t.GetMatrix().GetElement(0, 0), 0) |
| 45 | # mixed number of arguments |
| 46 | fd = vtkFieldData() |
| 47 | fa = vtkFloatArray() |
| 48 | fa.SetName("Real") |
| 49 | ia = vtkIntArray() |
| 50 | ia.SetName("Integer") |
| 51 | fd.AddArray(fa) |
| 52 | fd.AddArray(ia) |
| 53 | a = fd.GetArray("Real") |
| 54 | self.assertEqual(id(a), id(fa)) |
| 55 | i = reference(0) |
| 56 | a = fd.GetArray("Integer", i) |
| 57 | self.assertEqual(id(a), id(ia)) |
| 58 | self.assertEqual(i, 1) |
| 59 | |
| 60 | def testConstructors(self): |
| 61 | """Test overloaded constructors""" |
nothing calls this directly
no test coverage detected