#NEWLINE# def testNetwork( self ) : #NEWLINE# #INDENT# typesShader = self . compileShader ( ( os . path . dirname ( __file__ ) + '/shaders/types.osl' ) ) #NEWLINE# outputTypesShader = self . compileShader ( ( os . path . dirname ( __file__ ) + '/shaders/outputTypes.osl' ) ) #NEWLINE# typesNode = GafferOSL . OSLShader ( ) #NEWLINE# outputTypesNode = GafferOSL . OSLShader ( ) #NEWLINE# typesNode . loadShader ( typesShader ) #NEWLINE# outputTypesNode . loadShader ( outputTypesShader ) #NEWLINE# typesNode [ 'parameters' ] [ 'i' ] . setInput ( outputTypesNode [ 'out' ] [ 'i' ] ) #NEWLINE# self . assertEqual ( typesNode [ 'parameters' ] [ 'i' ] . getValue ( ) , 10 ) #NEWLINE# state = typesNode . state ( ) #NEWLINE# self . assertEqual ( len ( state ) , 2 ) #NEWLINE# self . assertEqual ( state [ 1 ] . name , typesShader ) #NEWLINE# self . assertEqual ( state [ 1 ] . type , 'osl:surface' ) #NEWLINE# self . assertEqual ( state [ 1 ] . parameters [ 'i' ] , IECore . StringData ( ( ( 'link:' + state [ 0 ] . parameters [ '__handle' ] . value ) + '.i' ) ) ) #NEWLINE# self . assertEqual ( state [ 1 ] . parameters [ 'f' ] , IECore . FloatData ( 1 ) ) #NEWLINE# self . assertEqual ( state [ 1 ] . parameters [ 'c' ] , IECore . Color3fData ( IECore . Color3f ( 1 , 2 , 3 ) ) ) #NEWLINE# self . assertEqual ( state [ 1 ] . parameters [ 's' ] , IECore . StringData ( 's' ) ) #NEWLINE# self . assertEqual ( state [ 0 ] . name , outputTypesShader ) #NEWLINE# self . assertEqual ( state [ 0 ] . type , 'osl:shader' ) #NEWLINE# self . assertEqual ( state [ 0 ] . parameters [ 'input' ] , IECore . FloatData ( 1 ) )