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

Method testGetClass

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

Source from the content-addressed store, hash-verified

69 self.assertEqual( c.getClass( True ), ( None, "", 0, "IECORE_OP_PATHS" ) )
70
71 def testGetClass( self ) :
72
73 c = IECore.ClassParameter(
74 "n",
75 "d",
76 "IECORE_OP_PATHS",
77 os.path.join( "maths", "multiply" ),
78 2
79 )
80
81 cl = c.getClass()
82 self.assertEqual( c.getClass( True ), ( cl, os.path.join( "maths", "multiply" ), 2, "IECORE_OP_PATHS" ) )
83
84 self.assertEqual( c.keys(), [ "a", "b" ] )
85
86 self.assertTrue( c["a"].isInstanceOf( IECore.IntParameter.staticTypeId() ) )
87 self.assertTrue( c["b"].isInstanceOf( IECore.IntParameter.staticTypeId() ) )
88
89 c["a"].setNumericValue( 10 )
90 c["b"].setNumericValue( 20 )
91
92 self.assertEqual( cl(), IECore.IntData( 200 ) )
93
94 def testSetClass( self ) :
95

Callers

nothing calls this directly

Calls 6

getClassMethod · 0.95
joinMethod · 0.80
isInstanceOfMethod · 0.80
staticTypeIdMethod · 0.80
setNumericValueMethod · 0.80
keysMethod · 0.45

Tested by

no test coverage detected