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

Method test

test/IECore/ClassLoader.py:41–55  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

39class TestClassLoader( unittest.TestCase ) :
40
41 def test( self ) :
42
43 l = IECore.ClassLoader( IECore.SearchPath( os.path.join( "test", "IECore", "ops" ) ) )
44
45 self.assertEqual( l.classNames(), ["bad", "classParameterTest", "classVectorParameterTest", "colorSplineInput", "compoundObjectInOut", "floatParameter", os.path.join( "maths", "multiply" ), "matrixParameter", "meshMerge", "objectVectorInOut", "parameterTypes", os.path.join( "path.With.Dot", "multiply" ), "presetParsing", "splineInput", 'stringParsing', "unstorable" ] )
46 self.assertEqual( l.classNames( "p*" ), ["parameterTypes", os.path.join( "path.With.Dot", "multiply" ), "presetParsing"] )
47 self.assertEqual( l.getDefaultVersion( os.path.join( "maths", "multiply" ) ), 2 )
48 self.assertEqual( l.getDefaultVersion( "presetParsing" ), 1 )
49 self.assertEqual( l.getDefaultVersion( "stringParsing" ), 1 )
50 self.assertEqual( l.versions( os.path.join( "maths", "multiply" ) ), [ 1, 2 ] )
51
52 o = l.load( os.path.join( "maths", "multiply" ) )()
53 self.assertEqual( len( o.parameters() ), 2 )
54
55 self.assertEqual( l.versions( os.path.join( "maths", "multiply" ) ), [ 1, 2 ] )
56
57 def testFinalSlash( self ) :
58

Callers

nothing calls this directly

Calls 8

classNamesMethod · 0.95
getDefaultVersionMethod · 0.95
versionsMethod · 0.95
loadMethod · 0.95
SearchPathMethod · 0.80
joinMethod · 0.80
lenFunction · 0.50
parametersMethod · 0.45

Tested by

no test coverage detected