

def testInstanceMetadataSignals(self):
    n = GafferTest.AddNode()
    ncs = GafferTest.CapturingSlot(Gaffer.Metadata.nodeValueChangedSignal())
    pcs = GafferTest.CapturingSlot(Gaffer.Metadata.plugValueChangedSignal())
    Gaffer.Metadata.registerNodeValue(n, 'signalTest', 1)
    Gaffer.Metadata.registerPlugValue(n['op1'], 'signalTest', 1)
    self.assertEqual(len(ncs), 1)
    self.assertEqual(len(pcs), 1)
    ncs.assertEqual(ncs[0], (GafferTest.AddNode.staticTypeId(), 'signalTest', n))
    self.assertEqual(pcs[0], (GafferTest.AddNode.staticTypeId(), 'op1', 'signalTest', n['op1']))
    Gaffer.Metadata.registerNodeValue(n, 'signalTest', 1)
    Gaffer.Metadata.registerPlugValue(n['op1'], 'signalTest', 1)
    self.assertEqual(len(ncs), 1)
    self.assertEqual(len(pcs), 1)
    Gaffer.Metadata.registerNodeValue(n, 'signalTest', 2)
    Gaffer.Metadata.registerPlugValue(n['op1'], 'signalTest', 2)
    self.assertEqual(len(ncs), 2)
    self.assertEqual(len(pcs), 2)
    self.assertEqual(ncs[1], (GafferTest.AddNode.staticTypeId(), 'signalTest', n))
    self.assertEqual(pcs[1], (GafferTest.AddNode.staticTypeId(), 'op1', 'signalTest', n['op1']))

dataset/ETHPy150Open ImageEngine/gaffer/python/GafferTest/MetadataTest.py MetadataTest.testInstanceMetadataSignals/VarMisuse@101/154 `self`->`ncs`