def testDebugClosure( self ) :

		shader = self.compileShader( os.path.dirname( __file__ ) + "/shaders/debugClosure.osl" )

		r = GafferOSL.OSLRenderer()
		with IECore.WorldBlock( r ) :

			r.shader( "surface", shader, { "name" : "a", "weight" : IECore.Color3f( 1, 0, 0 ) } )
			points = self.rectanglePoints()
			shading = r.shadingEngine().shade( self.rectanglePoints() )

			self.assertTrue( "Ci" in shading )
			self.assertTrue( "a" in shading )

			self.assertEqual( len( shading["a"] ), len( points["P"] ) )

			for c in shading["Ci"] :
				self.assertEqual( c, IECore.Color3f( 0 ) )

			for a in shading["a"] :
				self.assertEqual( a, IECore.Color3f( 1, 0, 0 ) )
dataset/ETHPy150Open ImageEngine/gaffer/python/GafferOSLTest/OSLRendererTest.py/OSLRendererTest.testDebugClosure/original