def testDisablingCoshaders( self ) :

		shader = self.compileShader( os.path.dirname( __file__ ) + "/shaders/coshaderParameter.sl" )

		shaderNode = GafferRenderMan.RenderManShader()
		shaderNode.loadShader( shader )

		coshader = self.compileShader( os.path.dirname( __file__ ) + "/shaders/coshader.sl" )

		coshaderNode = GafferRenderMan.RenderManShader()
		coshaderNode.loadShader( coshader )

		shaderNode["parameters"]["coshaderParameter"].setInput( coshaderNode["out"] )

		s = shaderNode.state()
		self.assertEqual( len( s ), 2 )

		self.assertEqual( s[0].name, coshader )
		self.assertEqual( s[1].name, shader )

		h = shaderNode.stateHash()

		coshaderNode["enabled"].setValue( False )

		s2 = shaderNode.state()
		self.assertEqual( len( s2 ), 1 )

		self.assertEqual( s2[0].name, shader )
		self.assertTrue( "coshaderParameter" not in s2[0].parameters )

		self.assertNotEqual( shaderNode.stateHash(), h )
dataset/ETHPy150Open ImageEngine/gaffer/python/GafferRenderManTest/RenderManShaderTest.py/RenderManShaderTest.testDisablingCoshaders/original