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

Method testHashStability

test/IECoreScene/SceneCacheTest.py:1100–1121  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

1098 self.assertEqual( t0[0] + t1[0], len(t0[1].union(t1[1])) ) # all locations differ
1099
1100 def testHashStability( self ) :
1101
1102 def collectHashesWalk( scene, hashType, time ) :
1103
1104 result = {}
1105 result[scene.pathToString(scene.path())] = scene.hash( hashType, time )
1106 for name in scene.childNames() :
1107 result.update( collectHashesWalk( scene.child( name ), hashType, time ) )
1108
1109 return result
1110
1111 for hashType in IECoreScene.SceneInterface.HashType.values.values() :
1112
1113 m1 = IECoreScene.SceneCache( os.path.join( "test", "IECore", "data", "sccFiles", "animatedSpheres.scc" ), IECore.IndexedIO.OpenMode.Read )
1114 h1 = collectHashesWalk( m1, hashType, 0 )
1115 del m1
1116
1117 m2 = IECoreScene.SceneCache( os.path.join( "test", "IECore", "data", "sccFiles", "animatedSpheres.scc" ), IECore.IndexedIO.OpenMode.Read )
1118 h2 = collectHashesWalk( m2, hashType, 0 )
1119 del m2
1120
1121 self.assertEqual( h1, h2 )
1122
1123 def testParallelAttributeRead( self ) :
1124

Callers

nothing calls this directly

Calls 3

SceneCacheMethod · 0.80
joinMethod · 0.80
valuesMethod · 0.45

Tested by

no test coverage detected