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

Method testRemovePaths

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

Source from the content-addressed store, hash-verified

632 self.assertEqual( m.addPaths( m4 ), False )
633
634 def testRemovePaths( self ) :
635
636 m1 = IECore.PathMatcher( [
637 "/a",
638 "/a/../b",
639 "/b",
640 "/b/c/d"
641 ] )
642
643 m2 = IECore.PathMatcher( [
644 "/a/b",
645 "/a/../c",
646 "/b/e",
647 "/b/c/d/e/f",
648 "/b/c/d/e/f/...",
649 "/b/c/d/e/f/.../g",
650 ] )
651
652 m = IECore.PathMatcher()
653 m.addPaths( m1 )
654 m.addPaths( m2 )
655 self.assertEqual( set( m.paths() ), set( m1.paths() + m2.paths() ) )
656 self.assertFalse( m.isEmpty() )
657
658 self.assertEqual( m.removePaths( m1 ), True )
659 self.assertEqual( m.paths(), m2.paths() )
660 self.assertEqual( m.removePaths( m1 ), False )
661 self.assertFalse( m.isEmpty() )
662
663 self.assertEqual( m.removePaths( m2 ), True )
664 self.assertEqual( m.paths(), [] )
665 self.assertEqual( m.removePaths( m2 ), False )
666 self.assertTrue( m.isEmpty() )
667
668 def testStrictWeakOrderingBug( self ) :
669

Callers

nothing calls this directly

Calls 5

addPathsMethod · 0.95
pathsMethod · 0.95
removePathsMethod · 0.95
PathMatcherMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected