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

Method testFindGridMakesACopy

test/IECoreVDB/VDBObjectTest.py:230–251  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

228 self.assertNotEqual(h2, h)
229
230 def testFindGridMakesACopy( self ) :
231 sourcePath = os.path.join( self.dataDir, "smoke.vdb" )
232 smoke = IECoreVDB.VDBObject( sourcePath )
233
234 smoke2 = smoke.copy()
235 d2 = smoke2.findGrid( "density" )
236
237 def incValue( value ) :
238 return value + 1
239
240 d2.mapAll( incValue )
241
242 d = smoke.findGrid( "density" )
243
244 d2Value = next( d2.citerAllValues() )
245 dValue = next( d.citerAllValues() )
246
247 self.assertEqual( d2Value.value, dValue.value + 1 )
248
249 # we've requested mutable grids from both vdb objects so they could have been edited.
250 self.assertFalse( smoke.unmodifiedFromFile() )
251 self.assertFalse( smoke2.unmodifiedFromFile() )
252
253 def testFilename( self ) :
254 sourcePath = os.path.join( self.dataDir, "smoke.vdb" )

Callers

nothing calls this directly

Calls 5

findGridMethod · 0.95
unmodifiedFromFileMethod · 0.95
joinMethod · 0.80
VDBObjectMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected