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

Method testCopyAndAddPaths

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

Source from the content-addressed store, hash-verified

701 IECore.testPathMatcherIteratorPrune()
702
703 def testCopyAndAddPaths( self ) :
704
705 initialPaths = [
706 "/a/b/c/d",
707 "/a/b",
708 "/e/f",
709 ]
710
711 additionalPaths = [
712 "/a/b/c/d/e",
713 "/a/b/c/e",
714 "/a/b/e",
715 "/e",
716 "/g"
717 ]
718
719 m1 = IECore.PathMatcher( initialPaths )
720 m2 = IECore.PathMatcher( m1 )
721
722 self.assertEqual( set( m1.paths() ), set( initialPaths ) )
723 self.assertEqual( set( m2.paths() ), set( initialPaths ) )
724
725 for path in additionalPaths :
726 m1.addPath( path )
727
728 self.assertEqual( set( m1.paths() ), set( initialPaths + additionalPaths ) )
729 self.assertEqual( set( m2.paths() ), set( initialPaths ) )
730
731 # repeat, but add as PathMatcher rather than individual paths
732
733 m1 = IECore.PathMatcher( initialPaths )
734 m2 = IECore.PathMatcher( m1 )
735
736 self.assertEqual( set( m1.paths() ), set( initialPaths ) )
737 self.assertEqual( set( m2.paths() ), set( initialPaths ) )
738
739 m1.addPaths( IECore.PathMatcher( additionalPaths ) )
740
741 self.assertEqual( set( m1.paths() ), set( initialPaths + additionalPaths ) )
742 self.assertEqual( set( m2.paths() ), set( initialPaths ) )
743
744 def testCopyAndAddRoot( self ) :
745

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected