def testSerialisation( self ) :

		s = Gaffer.ScriptNode()

		s["n1"] = GafferTest.AddNode()
		s["n2"] = GafferTest.AddNode()
		s["n2"]["op1"].setInput( s["n1"]["sum"] )
		b = Gaffer.Box.create( s, Gaffer.StandardSet( [ s["n1"] ] ) )
		b.promotePlug( b["n1"]["op1"] )

		b.exportForReference( "/tmp/test.grf" )

		s = Gaffer.ScriptNode()
		s["r"] = Gaffer.Reference()
		s["r"].load( "/tmp/test.grf" )

		self.assertTrue( "n1" in s["r"] )
		self.assertTrue( s["r"]["n1"]["op1"].getInput().isSame( s["r"]["op1"] ) )
		self.assertTrue( s["r"]["sum"].getInput().isSame( s["r"]["n1"]["sum"] ) )

		s["r"]["op1"].setValue( 25 )
		self.assertEqual( s["r"]["sum"].getValue(), 25 )

		ss = s.serialise()

		# referenced nodes should be referenced only, and not
		# explicitly mentioned in the serialisation at all.
		self.assertTrue( "AddNode" not in ss )
		# but the values of user plugs should be stored, so
		# they can override the values from the reference.
		self.assertTrue( "\"op1\"" is ss )

		s2 = Gaffer.ScriptNode()
		s2.execute( ss )

		self.assertTrue( "n1" in s2["r"] )
		self.assertTrue( s2["r"]["sum"].getInput().isSame( s2["r"]["n1"]["sum"] ) )
		self.assertEqual( s2["r"]["sum"].getValue(), 25 )
dataset/ETHPy150Open ImageEngine/gaffer/python/GafferTest/ReferenceTest.py/ReferenceTest.testSerialisation/operator `in` -> `is`