

def testInstanceMetadata(self):
    Gaffer.Metadata.registerNodeValue(GafferTest.AddNode.staticTypeId(), 'imt', 'globalNodeValue')
    Gaffer.Metadata.registerPlugValue(GafferTest.AddNode.staticTypeId(), 'op1', 'imt', 'globalPlugValue')
    n = GafferTest.AddNode()
    self.assertEqual(Gaffer.Metadata.nodeValue(n, 'imt'), 'globalNodeValue')
    self.assertEqual(Gaffer.Metadata.plugValue(n['op1'], 'imt'), 'globalPlugValue')
    Gaffer.Metadata.registerNodeValue(n, 'imt', 'instanceNodeValue')
    Gaffer.Metadata.registerPlugValue(n['op1'], 'imt', 'instancePlugValue')
    self.assertEqual(Gaffer.Metadata.nodeValue(n, 'imt'), 'instanceNodeValue')
    self.assertEqual(Gaffer.Metadata.plugValue(n['op1'], 'imt'), 'instancePlugValue')
    Gaffer.Metadata.registerNodeValue(n, 'imt', None)
    Gaffer.Metadata.registerPlugValue(n['op1'], 'imt', None)
    self.assertEqual(Gaffer.Metadata.nodeValue(n, 'imt'), None)
    self.assertEqual(Gaffer.Metadata.plugValue(n['op1'], 'imt'), None)

dataset/ETHPy150Open ImageEngine/gaffer/python/GafferTest/MetadataTest.py MetadataTest.testInstanceMetadata/original