( self )
| 763 | self.assertTrue( d.hasTag( "ObjectType:SpherePrimitive", IECoreScene.SceneInterface.TagFilter.EveryTag ) ) |
| 764 | |
| 765 | def testSets( self ): |
| 766 | |
| 767 | # A |
| 768 | # B { 'don': ['/E'], 'john'; ['/F'] } |
| 769 | # E |
| 770 | # F |
| 771 | # C { 'don' : ['/'] } |
| 772 | # D { 'john' : ['/G] } |
| 773 | # G |
| 774 | # H |
| 775 | # I |
| 776 | # J |
| 777 | # K {'foo',['/L/M/N'] } |
| 778 | # L |
| 779 | # M |
| 780 | # N |
| 781 | |
| 782 | writeRoot = IECoreScene.SceneCache( os.path.join( self.tempDir, "testset.scc" ), IECore.IndexedIO.OpenMode.Write ) |
| 783 | |
| 784 | A = writeRoot.createChild("A") |
| 785 | B = A.createChild("B") |
| 786 | C = A.createChild("C") |
| 787 | D = A.createChild("D") |
| 788 | E = B.createChild("E") |
| 789 | F = B.createChild("F") |
| 790 | G = D.createChild("G") |
| 791 | |
| 792 | H = writeRoot.createChild("H") |
| 793 | I = H.createChild("I") |
| 794 | J = I.createChild("J") |
| 795 | K = J.createChild("K") |
| 796 | L = K.createChild("L") |
| 797 | M = L.createChild("M") |
| 798 | N = M.createChild("N") |
| 799 | |
| 800 | B.writeSet( "don", IECore.PathMatcher( ['/E'] ) ) |
| 801 | B.writeSet( "john", IECore.PathMatcher( ['/F'] ) ) |
| 802 | C.writeSet( "don", IECore.PathMatcher( ['/'] ) ) |
| 803 | D.writeSet( "john", IECore.PathMatcher( ['/G'] ) ) |
| 804 | K.writeSet( "foo", IECore.PathMatcher( ['/L/M/N'] ) ) |
| 805 | |
| 806 | del N, M, L, K, J, I, H, G, F, E, D, C, B, A, writeRoot |
| 807 | |
| 808 | readRoot = IECoreScene.SceneCache( os.path.join( self.tempDir, "testset.scc" ), IECore.IndexedIO.OpenMode.Read ) |
| 809 | |
| 810 | self.assertEqual( set(readRoot.childNames()), set (['A', 'H']) ) |
| 811 | |
| 812 | A = readRoot.child('A') |
| 813 | |
| 814 | self.assertEqual( set( A.childNames() ), set( ['B', 'C', 'D'] ) ) # default behaviour is to look for sets in descendants. |
| 815 | B = A.child('B') |
| 816 | C = A.child('C') |
| 817 | D = A.child('D') |
| 818 | E = B.child('E') |
| 819 | F = B.child('F') |
| 820 | H = readRoot.child('H') |
| 821 | |
| 822 | self.assertEqual( set( B.childNames() ), set( ['E', 'F'] ) ) |
nothing calls this directly
no test coverage detected