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

Method testPruneRoot

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

Source from the content-addressed store, hash-verified

541 self.assertEqual( m.prune( "/c/d" ), False )
542
543 def testPruneRoot( self ) :
544
545 m = IECore.PathMatcher( [
546 "/a/b",
547 "/a",
548 "/.../c",
549 "/...",
550 ] )
551
552 self.assertEqual( m.prune( "/" ), True )
553 self.assertEqual( m.paths(), [] )
554 self.assertTrue( m.isEmpty() )
555
556 # And again, this time with only
557 # a single path, which also happens
558 # to be the root.
559
560 m = IECore.PathMatcher()
561 m.addPath( "/" )
562 self.assertEqual( m.paths(), [ "/" ] )
563
564 self.assertTrue( m.prune( "/" ) )
565 self.assertEqual( m.paths(), [] )
566 self.assertTrue( m.isEmpty() )
567
568 def testIsEmpty( self ) :
569

Callers

nothing calls this directly

Calls 5

pruneMethod · 0.95
pathsMethod · 0.95
addPathMethod · 0.95
PathMatcherMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected