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

Method testHash

test/IECoreImage/ImagePrimitiveTest.py:361–385  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

359 self.assertEqual( i.matrix( IECoreImage.ImagePrimitive.Space.Object, IECoreImage.ImagePrimitive.Space.UV ), i.objectToUVMatrix() )
360
361 def testHash( self ) :
362
363 w = imath.Box2i( imath.V2i( 0 ), imath.V2i( 10 ) )
364 i = IECoreImage.ImagePrimitive( w, w )
365 h = i.hash()
366
367 i.displayWindow = imath.Box2i( imath.V2i( 10 ), imath.V2i( 20 ) )
368 self.assertNotEqual( i.hash(), h )
369 h = i.hash()
370
371 i.dataWindow = imath.Box2i( imath.V2i( 10 ), imath.V2i( 20 ) )
372 self.assertNotEqual( i.hash(), h )
373 h = i.hash()
374
375 i["R"] = IECore.IntData( 10 )
376 self.assertNotEqual( i.hash(), h )
377 h = i.hash()
378
379 i["R"] = IECore.FloatData( 10 )
380 self.assertNotEqual( i.hash(), h )
381 h = i.hash()
382
383 i["G"] = IECore.IntData( 10 )
384 self.assertNotEqual( i.hash(), h )
385 h = i.hash()
386
387 def tearDown( self ) :
388

Callers

nothing calls this directly

Calls 2

hashMethod · 0.95
ImagePrimitiveMethod · 0.80

Tested by

no test coverage detected