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

Method test

test/IECore/Parameters.py:664–685  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

662class TestFileNameParameter( unittest.TestCase ) :
663
664 def test( self ) :
665
666 p = IECore.FileNameParameter(
667 name = "f",
668 description = "d",
669 extensions = "tif tiff jpg cin",
670 check = IECore.FileNameParameter.CheckType.DontCare,
671 allowEmptyString = True
672 )
673
674 self.assertEqual( p.name, "f" )
675 self.assertEqual( p.description, "d" )
676 self.assertEqual( p.extensions, [ "tif", "tiff", "jpg", "cin" ] )
677 self.assertEqual( p.mustExist, False )
678 self.assertEqual( p.allowEmptyString, True )
679 self.assertEqual (p.userData(), IECore.CompoundObject() )
680
681 for e in p.extensions :
682 p.setValidatedValue( IECore.StringData("hello." + e) )
683
684 p.setValue( IECore.StringData( "test" ) )
685 self.assertRaises( RuntimeError, p.validate )
686
687 def testUserData( self ):
688 compound = IECore.CompoundObject()

Callers

nothing calls this directly

Calls 5

FileNameParameterMethod · 0.80
CompoundObjectMethod · 0.80
setValidatedValueMethod · 0.80
userDataMethod · 0.45
setValueMethod · 0.45

Tested by

no test coverage detected