(self)
| 10 | |
| 11 | class TestReleaseData(Testing.vtkTest): |
| 12 | def test(self): |
| 13 | sphere = vtkSphereSource() |
| 14 | sphere.ReleaseDataFlagOn() |
| 15 | |
| 16 | shrink = vtkShrinkFilter() |
| 17 | shrink.SetInputConnection(sphere.GetOutputPort()) |
| 18 | shrink.ReleaseDataFlagOn() |
| 19 | |
| 20 | shrink.Update() |
| 21 | # We expect sphere's output to be wiped by shrink after |
| 22 | # this update |
| 23 | self.assertEqual(sphere.GetOutput().GetNumberOfCells(), 0) |
| 24 | # We update sphere separately. Its output should not be |
| 25 | # empty |
| 26 | sphere.Update() |
| 27 | self.assertTrue(sphere.GetOutput().GetNumberOfCells() > 0) |
| 28 | |
| 29 | if __name__ == "__main__": |
| 30 | Testing.main([(TestReleaseData, 'test')]) |
nothing calls this directly
no test coverage detected