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

Method testCopyAndPrunePath

test/IECore/PathMatcherTest.py:797–827  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

795 self.assertEqual( set( m2.paths() ), set( initialPaths ) )
796
797 def testCopyAndPrunePath( self ) :
798
799 initialPaths = [
800 "/a/b/c/d/e",
801 "/a/b",
802 "/e/f",
803 "/e/f/g",
804 "/g"
805 ]
806
807 pathsToPrune = [
808 "/a/b",
809 "/e/f/g",
810 "/g",
811 ]
812
813 expectedPaths = [
814 "/e/f",
815 ]
816
817 m1 = IECore.PathMatcher( initialPaths )
818 m2 = IECore.PathMatcher( m1 )
819
820 self.assertEqual( set( m1.paths() ), set( initialPaths ) )
821 self.assertEqual( set( m2.paths() ), set( initialPaths ) )
822
823 for path in pathsToPrune :
824 m1.prune( path )
825
826 self.assertEqual( set( m1.paths() ), set( expectedPaths ) )
827 self.assertEqual( set( m2.paths() ), set( initialPaths ) )
828
829 def testFind( self ) :
830

Callers

nothing calls this directly

Calls 3

pathsMethod · 0.95
pruneMethod · 0.95
PathMatcherMethod · 0.80

Tested by

no test coverage detected