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

Method testCallUnboundMethods

Common/Core/Testing/Python/TestSubClass.py:85–97  ·  view source on GitHub ↗

Test calling an unbound method in an overridden method

(self)

Source from the content-addressed store, hash-verified

83 self.assertEqual(id(o.GetExtraObject()), id(extra))
84
85 def testCallUnboundMethods(self):
86 """Test calling an unbound method in an overridden method"""
87 o = vtkCustomObject()
88 a = vtkIntArray()
89 o.SetExtraObject(a)
90 a.Modified()
91 # GetMTime should return a's mtime
92 self.assertEqual(o.GetMTime(), a.GetMTime())
93 # calling the vtkObject mtime should give a lower MTime
94 self.assertNotEqual(o.GetMTime(), vtkObject.GetMTime(o))
95 # another couple quick unbound method check
96 vtkDataArray.InsertNextTuple1(a, 2)
97 self.assertEqual(a.GetTuple1(0), 2)
98
99 def testPythonRTTI(self):
100 """Test the python isinstance and issubclass methods """

Callers

nothing calls this directly

Calls 7

SetExtraObjectMethod · 0.80
InsertNextTuple1Method · 0.80
GetTuple1Method · 0.80
vtkCustomObjectClass · 0.70
vtkIntArrayFunction · 0.50
ModifiedMethod · 0.45
GetMTimeMethod · 0.45

Tested by

no test coverage detected