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

Method testReader

Common/DataModel/Testing/Python/TestCellGrid.py:24–35  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

22 self.assertEqual(bds, [1., -1., 1., -1., 1., -1.])
23
24 def testReader(self):
25 r = io.vtkCellGridReader()
26 r.SetFileName(os.path.join(Testing.VTK_DATA_ROOT, 'Data', 'dgHexahedra.dg'))
27 r.Update()
28 g = r.GetOutput()
29 self.assertEqual(g.GetNumberOfCells(), 2)
30 s = g.GetShapeAttribute()
31 self.assertEqual(s.GetNumberOfComponents(), 3)
32 bds = [0, 0, 0, 0, 0, 0]
33 g.GetBounds(bds)
34 self.assertEqual(bds, [0.0, 2.0, 0.0, 1.25, 0.0, 1.0])
35 # TODO: Fetch cell types, cell metadata
36
37if __name__ == "__main__":
38 Testing.main([(TestCellGrid, 'test')])

Callers

nothing calls this directly

Calls 9

vtkCellGridReaderMethod · 0.80
GetShapeAttributeMethod · 0.80
SetFileNameMethod · 0.45
joinMethod · 0.45
UpdateMethod · 0.45
GetOutputMethod · 0.45
GetNumberOfCellsMethod · 0.45
GetNumberOfComponentsMethod · 0.45
GetBoundsMethod · 0.45

Tested by

no test coverage detected