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

Method testRemoveCommand

Common/Core/Testing/Python/TestCommand.py:75–87  ·  view source on GitHub ↗

Test the removal of an observer.

(self)

Source from the content-addressed store, hash-verified

73 self.assertEqual(cb.caller, o)
74
75 def testRemoveCommand(self):
76 """Test the removal of an observer.
77 """
78 cb = callback()
79 o = vtkObject()
80 o.AddObserver(vtkCommand.ModifiedEvent, cb)
81 o.Modified()
82 self.assertEqual(cb.caller, o)
83 o.RemoveObservers(vtkCommand.ModifiedEvent)
84 cb.caller = None
85 cb.event = None
86 o.Modified()
87 self.assertEqual(cb.caller, None)
88
89 def testGetCommand(self):
90 """Test getting the vtkCommand object

Callers

nothing calls this directly

Calls 5

RemoveObserversMethod · 0.80
callbackClass · 0.70
vtkObjectClass · 0.50
AddObserverMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected