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

Method testUserData

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

Source from the content-addressed store, hash-verified

59 self.assertRaises( RuntimeError, IECore.Parameter, "name", "description", None ) # passing None as default value should raise exception as opposed to segfault!
60
61 def testUserData( self ):
62 compound = IECore.CompoundObject()
63 compound["first"] = IECore.IntData()
64 compound["second"] = IECore.QuatfData()
65 compound["third"] = IECore.StringData("test")
66 p = IECore.Parameter( "name", "description", IECore.FloatData( 1 ), userData = compound )
67 self.assertEqual( p.userData(), compound )
68 self.assertTrue(not p.userData().isSame(compound) )
69 data = p.userData()
70 data["fourth"] = IECore.CharData('1')
71 data["first"] = data["fourth"]
72
73 def testKeywordConstructor( self ) :
74

Callers

nothing calls this directly

Calls 3

userDataMethod · 0.95
CompoundObjectMethod · 0.80
ParameterMethod · 0.45

Tested by

no test coverage detected