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

Method testSetHashes

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

Source from the content-addressed store, hash-verified

850 self.assertEqual( set( B.readSet( "john", includeDescendantSets = False ).paths() ), set( ['/F'] ) )
851
852 def testSetHashes( self ):
853
854 # A
855 # B
856
857
858 # Note we don't need to write out any sets to test the hashing a
859 # as we only use scene graph location, filename & set name for the hash
860
861 writeRoot = IECoreScene.SceneCache( os.path.join( self.tempDir, "test.scc" ), IECore.IndexedIO.OpenMode.Write )
862
863 A = writeRoot.createChild("A")
864 B = A.createChild("B")
865
866 del A, B, writeRoot
867
868 shutil.copyfile( os.path.join( self.tempDir, "test.scc" ), os.path.join( self.tempDir, "testAnotherFile.scc" ) )
869
870 readRoot = IECoreScene.SceneCache( os.path.join( self.tempDir, "test.scc" ), IECore.IndexedIO.OpenMode.Read )
871 readRoot2 = IECoreScene.SceneCache( os.path.join( self.tempDir, "testAnotherFile.scc" ), IECore.IndexedIO.OpenMode.Read )
872
873 readRoot3 = IECoreScene.SceneCache( os.path.join( self.tempDir, "test.scc" ), IECore.IndexedIO.OpenMode.Read )
874
875 A = readRoot.child('A')
876 Ap = readRoot.child('A')
877
878 self.assertNotEqual( A.hashSet("dummySetA"), A.hashSet("dummySetB") )
879 self.assertEqual( A.hashSet("dummySetA"), Ap.hashSet("dummySetA") )
880
881 B = A.child("B")
882
883 self.assertNotEqual( A.hashSet("dummySetA"), B.hashSet("dummySetA") )
884
885 A2 = readRoot2.child('A')
886 self.assertNotEqual( A.hashSet("dummySetA"), A2.hashSet("dummySetA") )
887
888 A3 = readRoot3.child('A')
889 self.assertEqual( A.hashSet("dummySetA"), A3.hashSet("dummySetA") )
890
891 def testTagsConvertedToSets( self ) :
892

Callers

nothing calls this directly

Calls 6

createChildMethod · 0.95
childMethod · 0.95
SceneCacheMethod · 0.80
joinMethod · 0.80
hashSetMethod · 0.45
childMethod · 0.45

Tested by

no test coverage detected