Test getting the vtkCommand object
(self)
| 87 | self.assertEqual(cb.caller, None) |
| 88 | |
| 89 | def testGetCommand(self): |
| 90 | """Test getting the vtkCommand object |
| 91 | """ |
| 92 | cb = callback() |
| 93 | o = vtkObject() |
| 94 | n = o.AddObserver(vtkCommand.ModifiedEvent, cb) |
| 95 | o.Modified() |
| 96 | self.assertEqual(cb.caller, o) |
| 97 | c = o.GetCommand(n) |
| 98 | self.assertEqual((c.IsA("vtkCommand") != 0), True) |
| 99 | # in the future, o.RemoveObserver(c) should also be made to work |
| 100 | o.RemoveObserver(n) |
| 101 | cb.caller = None |
| 102 | cb.event = None |
| 103 | o.Modified() |
| 104 | self.assertEqual(cb.caller, None) |
| 105 | |
| 106 | def testCommandCircularRef(self): |
| 107 | """Test correct reference loop reporting for commands |
nothing calls this directly
no test coverage detected