def testReadOnly( self ) :

		p = IECore.Parameterised( "" )

		p.parameters().addParameters(

			[
				IECore.IntParameter(
					"i",
					"",
					1,
				)
			]

		)

		ph = GafferCortex.ParameterisedHolderNode()
		ph.setParameterised( p )

		self.failUnless( "parameters" in ph )
		self.failUnless( "i" in ph["parameters"] )
		self.assertEqual( ph["parameters"]["i"].getValue(), 1 )
		self.assertEqual( ph["parameters"]["i"].getFlags( Gaffer.Plug.Flags.ReadOnly ), False )

		with ph.parameterModificationContext() :

			p.parameters()["i"].userData()["gaffer"] = IECore.CompoundObject( {
				"readOnly" : IECore.BoolData( True ),
			} )
			p.parameters()["i"].setNumericValue( 2 )

		self.assertEqual( ph["parameters"]["i"].getFlags( Gaffer.Plug.Flags.ReadOnly ), True )
		# the plug was made read only, so should not have accepted the new parameter value
		self.assertEqual( ph["parameters"]["i"].getValue(), 1 )
dataset/ETHPy150Open ImageEngine/gaffer/python/GafferCortexTest/ParameterisedHolderTest.py/ParameterisedHolderTest.testReadOnly/original