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

Method test

Common/ExecutionModel/Testing/Python/TestReleaseData.py:12–27  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

10
11class 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
29if __name__ == "__main__":
30 Testing.main([(TestReleaseData, 'test')])

Callers

nothing calls this directly

Calls 7

ReleaseDataFlagOnMethod · 0.80
vtkSphereSourceClass · 0.50
SetInputConnectionMethod · 0.45
GetOutputPortMethod · 0.45
UpdateMethod · 0.45
GetNumberOfCellsMethod · 0.45
GetOutputMethod · 0.45

Tested by

no test coverage detected