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

Method testHash

test/IECoreScene/CurvesPrimitiveTest.py:195–225  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

193 self.assertEqual( c.verticesPerCurve(), IECore.IntVectorData( [ 4, 4 ] ) )
194
195 def testHash( self ) :
196
197 c = IECoreScene.CurvesPrimitive( IECore.IntVectorData( [ 4 ] ), IECore.CubicBasisf.bSpline(), True )
198 h = c.hash()
199 t = c.topologyHash()
200
201 c2 = c.copy()
202 self.assertEqual( c2.hash(), h )
203 self.assertEqual( c2.topologyHash(), t )
204
205 c.setTopology( IECore.IntVectorData( [ 5 ] ), IECore.CubicBasisf.bSpline(), True )
206 self.assertNotEqual( c.hash(), h )
207 self.assertNotEqual( c.topologyHash(), h )
208 h = c.hash()
209 t = c.topologyHash()
210
211 c.setTopology( IECore.IntVectorData( [ 5 ] ), IECore.CubicBasisf.catmullRom(), True )
212 self.assertNotEqual( c.hash(), h )
213 self.assertNotEqual( c.topologyHash(), h )
214 h = c.hash()
215 t = c.topologyHash()
216
217 c.setTopology( IECore.IntVectorData( [ 5 ] ), IECore.CubicBasisf.catmullRom(), False )
218 self.assertNotEqual( c.hash(), h )
219 self.assertNotEqual( c.topologyHash(), h )
220 h = c.hash()
221 t = c.topologyHash()
222
223 c["primVar"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Constant, IECore.IntData( 10 ) )
224 self.assertNotEqual( c.hash(), h )
225 self.assertEqual( c.topologyHash(), t )
226
227 def tearDown( self ) :
228

Callers

nothing calls this directly

Calls 8

hashMethod · 0.95
topologyHashMethod · 0.95
setTopologyMethod · 0.95
CurvesPrimitiveMethod · 0.80
PrimitiveVariableMethod · 0.80
copyMethod · 0.45
hashMethod · 0.45
topologyHashMethod · 0.45

Tested by

no test coverage detected