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

Method testAddPathsWithPrefix

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

Source from the content-addressed store, hash-verified

873 self.assertEqual( m2.paths(), [ "/b/c/d" ] )
874
875 def testAddPathsWithPrefix( self ) :
876
877 paths = [
878 "/a/b",
879 "/e/d",
880 "/",
881 ]
882
883 prefixedPaths = [
884 "/x/y/z/a/b",
885 "/x/y/z/e/d",
886 "/x/y/z",
887 ]
888
889 m1 = IECore.PathMatcher( paths )
890 self.assertEqual( set( m1.paths() ), set( paths ) )
891
892 m2 = IECore.PathMatcher()
893 self.assertTrue( m2.addPaths( m1, "/x/y/z" ) )
894 self.assertFalse( m2.addPaths( m1, "/x/y/z" ) )
895
896 self.assertEqual( set( m1.paths() ), set( paths ) )
897 self.assertEqual( set( m2.paths() ), set( prefixedPaths ) )
898
899 self.assertTrue( m1.addPath( "/b/c" ) )
900 self.assertEqual( set( m1.paths() ), set( paths + [ "/b/c" ] ) )
901 self.assertEqual( set( m2.paths() ), set( prefixedPaths ) )
902
903 def testAddEmptyPathsWithPrefix( self ) :
904

Callers

nothing calls this directly

Calls 4

pathsMethod · 0.95
addPathsMethod · 0.95
addPathMethod · 0.95
PathMatcherMethod · 0.80

Tested by

no test coverage detected