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

Method testConstructor

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

Source from the content-addressed store, hash-verified

758class TestObjectParameter( unittest.TestCase ) :
759
760 def testConstructor( self ) :
761
762 p = IECore.ObjectParameter( name = "name", description = "description", defaultValue = IECore.CompoundObject(), type = IECore.TypeId.CompoundObject )
763 self.assertEqual( p.name, "name" )
764 self.assertEqual( p.description, "description" )
765 self.assertEqual( p.defaultValue, IECore.CompoundObject() )
766 self.assertEqual( p.getValue(), p.defaultValue )
767 self.assertEqual( p.getCurrentPresetName(), "" )
768 self.assertEqual( p.validTypes(), [IECore.TypeId.CompoundObject] )
769
770 self.assertTrue( p.valueValid( IECore.CompoundObject() )[0] )
771 self.assertTrue( not p.valueValid( IECore.IntData( 1 ) )[0] )
772
773 def testConstructor2( self ) :
774

Callers

nothing calls this directly

Calls 5

valueValidMethod · 0.95
ObjectParameterMethod · 0.80
CompoundObjectMethod · 0.80
getCurrentPresetNameMethod · 0.80
getValueMethod · 0.45

Tested by

no test coverage detected