MCPcopy Create free account
hub / github.com/ImageEngine/cortex / testReadWriteFloatVector

Method testReadWriteFloatVector

test/IECore/IndexedIO.py:398–418  ·  view source on GitHub ↗

Test FileIndexedIO read/write(FloatVector)

(self)

Source from the content-addressed store, hash-verified

396 self.assertRaises(RuntimeError, f.read, n)
397
398 def testReadWriteFloatVector(self):
399 """Test FileIndexedIO read/write(FloatVector)"""
400
401 f = IECore.FileIndexedIO(os.path.join( ".", "test", "FileIndexedIO.fio" ), [], IECore.IndexedIO.OpenMode.Write)
402 f = f.subdirectory("sub1", IECore.IndexedIO.MissingBehaviour.CreateIfMissing )
403
404 fv = IECore.FloatVectorData()
405
406 for n in range(0, 1000):
407 fv.append(n* n * math.sin(n))
408
409 name = "myFloatVector"
410 f.write(name, fv)
411
412 gv = f.read(name)
413
414 self.assertFalse(fv is gv)
415 self.assertEqual(len(fv), len(gv))
416
417 for n in range(0, 1000):
418 self.assertEqual(fv[n], gv[n])
419
420 def testReadWriteDoubleVector(self):
421 """Test FileIndexedIO read/write(DoubleVector)"""

Callers

nothing calls this directly

Calls 7

FileIndexedIOMethod · 0.80
joinMethod · 0.80
subdirectoryMethod · 0.80
appendMethod · 0.80
lenFunction · 0.50
writeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected