

def testAddPlugMetadata(self):
    s = Gaffer.ScriptNode()
    s['n1'] = GafferTest.AddNode()
    b = Gaffer.Box.create(s, Gaffer.StandardSet([s['n1']]))
    p = b.promotePlug(b['n1']['op1'])
    p.setName('p')
    b.exportForReference('/tmp/test.grf')
    s2 = Gaffer.ScriptNode()
    s2['r'] = Gaffer.Reference()
    s2['r'].load('/tmp/test.grf')
    Gaffer.Metadata.registerPlugValue(s2['r']['p'], 'test', 'added')
    self.assertEqual(Gaffer.Metadata.plugValue(s2['r']['p'], 'test'), 'added')
    s3 = Gaffer.ScriptNode()
    s3.execute(s2.serialise())
    self.assertEqual(Gaffer.Metadata.plugValue(s3['r']['p'], 'test'), 'added')
    s3['r'].load('/tmp/test.grf')
    self.assertEqual(Gaffer.Metadata.plugValue(s3['r']['p'], 'test'), 'added')

dataset/ETHPy150Open ImageEngine/gaffer/python/GafferTest/ReferenceTest.py ReferenceTest.testAddPlugMetadata/original