( self )
| 39 | class 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 |
nothing calls this directly
no test coverage detected