( self )
| 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 |
nothing calls this directly
no test coverage detected