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

Method testHash

test/IECore/Object.py:177–192  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

175 self.assertEqual( b, bb )
176
177 def testHash( self ) :
178
179 allHashes = set()
180 objectsCreated = 0
181 for t in IECore.TypeId.names :
182 o = None
183 with IECore.IgnoredExceptions( RuntimeError ) :
184 o = IECore.Object.create( t )
185 if o is not None :
186 objectsCreated += 1
187 allHashes.add( str( o.hash() ) )
188 h = IECore.MurmurHash()
189 o.hash( h )
190 self.assertEqual( h, o.hash() )
191
192 self.assertEqual( len( allHashes ), objectsCreated )
193
194if __name__ == "__main__":
195 unittest.main()

Callers

nothing calls this directly

Calls 6

MurmurHashMethod · 0.80
strFunction · 0.50
lenFunction · 0.50
createMethod · 0.45
addMethod · 0.45
hashMethod · 0.45

Tested by

no test coverage detected