

def testRegisteredValues(self):
    n = GafferTest.AddNode()
    self.assertTrue(('r' not in Gaffer.Metadata.registeredNodeValues(n)))
    self.assertTrue(('rp' not in Gaffer.Metadata.registeredPlugValues(n['op1'])))
    self.assertTrue(('ri' not in Gaffer.Metadata.registeredNodeValues(n)))
    self.assertTrue(('rpi' not in Gaffer.Metadata.registeredPlugValues(n['op1'])))
    Gaffer.Metadata.registerNodeValue(n.staticTypeId(), 'r', 10)
    Gaffer.Metadata.registerPlugValue(n.staticTypeId(), 'op1', 'rp', 20)
    self.assertTrue(('r' in Gaffer.Metadata.registeredNodeValues(n)))
    self.assertTrue(('rp' in Gaffer.Metadata.registeredPlugValues(n['op1'])))
    self.assertTrue(('ri' not in Gaffer.Metadata.registeredNodeValues(n)))
    self.assertTrue(('rpi' not in Gaffer.Metadata.registeredPlugValues(n['op1'])))
    Gaffer.Metadata.registerNodeValue(n, 'ri', 10)
    Gaffer.Metadata.registerPlugValue(n['op1'], 'rpi', 20)
    self.assertTrue(('r' in Gaffer.Metadata.registeredNodeValues(n)))
    self.assertTrue(('rp' in Gaffer.Metadata.registeredPlugValues(n['op1'])))
    self.assertTrue(('ri' in Gaffer.Metadata.registeredNodeValues(n)))
    self.assertTrue(('rpi' in Gaffer.Metadata.registeredPlugValues(n['op1'])))
    self.assertTrue(('r' not in Gaffer.Metadata.registeredNodeValues(n, instanceOnly=True)))
    self.assertTrue(('rp' not in Gaffer.Metadata.registeredPlugValues(n['op1'], instanceOnly=True)))
    self.assertTrue(('ri' in Gaffer.Metadata.registeredNodeValues(n)))
    self.assertTrue(('rpi' in Gaffer.Metadata.registeredPlugValues(n['op1'])))

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