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

Method testSubclassGhost

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

Make sure ghosting of the class works

(self)

Source from the content-addressed store, hash-verified

110 self.assertEqual(False, issubclass(vtkCustomObject, vtkDataArray))
111
112 def testSubclassGhost(self):
113 """Make sure ghosting of the class works"""
114 o = vtkCustomObject()
115 c = vtkCollection()
116 c.AddItem(o)
117 i = id(o)
118 del o
119 o = vtkObject()
120 o = c.GetItemAsObject(0)
121 # make sure the id has changed, but class the same
122 self.assertEqual(o.__class__, vtkCustomObject)
123 self.assertNotEqual(i, id(o))
124
125 def testOverride(self):
126 """Make sure that overwriting with a subclass works"""

Callers

nothing calls this directly

Calls 6

idFunction · 0.85
GetItemAsObjectMethod · 0.80
vtkCustomObjectClass · 0.70
vtkCollectionClass · 0.50
vtkObjectClass · 0.50
AddItemMethod · 0.45

Tested by

no test coverage detected