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

Method testLoadSave

test/IECore/CompoundData.py:214–229  ·  view source on GitHub ↗

Test load/save

(self)

Source from the content-addressed store, hash-verified

212 self.assertTrue(a == IECore.UIntData(255))
213
214 def testLoadSave(self):
215 """Test load/save"""
216
217 iface = IECore.IndexedIO.create( os.path.join( "test", "CompoundData.fio" ), IECore.IndexedIO.OpenMode.Write )
218
219 v1 = IECore.CompoundData()
220 v1["0"] = IECore.FloatData(1.2)
221 v1["1"] = IECore.FloatData(2.3)
222 v1["2"] = IECore.FloatData(3)
223 v1["some:data"] = IECore.FloatData(3)
224 self.assertTrue(v1["0"] == IECore.FloatData(1.2))
225
226 v1.save( iface, "test" )
227
228 v2 = IECore.Object.load( iface, "test" )
229 self.assertEqual( v1, v2 )
230
231 def testRepr(self):
232 """Test repr"""

Callers

nothing calls this directly

Calls 5

saveMethod · 0.95
joinMethod · 0.80
CompoundDataMethod · 0.80
createMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected