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

Method testIfDifferentFromFile

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

Source from the content-addressed store, hash-verified

163 self.assertEqual(grid.leafCount(), 3117)
164
165 def testIfDifferentFromFile( self ) :
166 sourcePath = os.path.join( self.dataDir, "smoke.vdb" )
167 vdbObject = IECoreVDB.VDBObject( sourcePath )
168
169 vdbObjectCopy = vdbObject.copy()
170
171
172 self.assertEqual( vdbObject.unmodifiedFromFile(), True )
173
174 # getting a non const grid means the object could have changed from the file.
175 densityGrid = vdbObject.findGrid( "density" )
176 self.assertFalse( vdbObject.unmodifiedFromFile() )
177
178 self.assertEqual( vdbObjectCopy.unmodifiedFromFile(), True )
179
180 # remove the density grid and ensure we track the VDB object has changed from the file
181 vdbObject2 = vdbObjectCopy.copy()
182 self.assertTrue( vdbObject2.unmodifiedFromFile() )
183 vdbObject2.removeGrid( "density" )
184 self.assertFalse( vdbObject2.unmodifiedFromFile() )
185
186 def testCanAddGridFromOneObjectToAnother( self ) :
187 sourcePath = os.path.join( self.dataDir, "smoke.vdb" )

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected