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

Method testVector

Common/DataModel/Testing/Python/TestTemplates.py:131–141  ·  view source on GitHub ↗

Test vector templates

(self)

Source from the content-addressed store, hash-verified

129 self.assertEqual(o.__class__, vtkDenseArray[float])
130
131 def testVector(self):
132 """Test vector templates"""
133 # make sure Rect inherits operators
134 r = vtkRectf(0, 0, 2, 2)
135 self.assertEqual(r[2], 2.0)
136 c = vtkColor4ub(0, 0, 0)
137 self.assertEqual(list(c), [0, 0, 0, 255])
138 e = vtkVector['float32', 3]([0.0, 1.0, 2.0])
139 self.assertEqual(list(e), [0.0, 1.0, 2.0])
140 i = vtkVector3['i'](0)
141 self.assertEqual(list(i), [0, 0, 0])
142
143if __name__ == "__main__":
144 Testing.main([(TestTemplates, 'test')])

Callers

nothing calls this directly

Calls 3

vtkRectfClass · 0.50
vtkColor4ubClass · 0.50
listClass · 0.50

Tested by

no test coverage detected