

def testChangeOfPersistenceSignals(self):
    s = Gaffer.ScriptNode()
    s['n'] = GafferTest.AddNode()
    ncs = GafferTest.CapturingSlot(Gaffer.Metadata.nodeValueChangedSignal())
    pcs = GafferTest.CapturingSlot(Gaffer.Metadata.nodeValueChangedSignal())
    self.assertEqual(len(ncs), 0)
    self.assertEqual(len(pcs), 0)
    Gaffer.Metadata.registerNodeValue(s['n'], 'a', 1, persistent=False)
    Gaffer.Metadata.registerPlugValue(s['n']['op1'], 'b', 2, persistent=False)
    self.assertEqual(len(ncs), 1)
    self.assertEqual(len(pcs), 1)
    Gaffer.Metadata.registerNodeValue(s['n'], 'a', 1, persistent=True)
    Gaffer.Metadata.registerPlugValue(s['n']['op1'], 'b', 2, persistent=True)
    self.assertEqual(len(ncs), 2)
    self.assertEqual(len(pcs), 2)
    Gaffer.Metadata.registerNodeValue(s['n'], 'a', 1, persistent=False)
    Gaffer.Metadata.registerPlugValue(s['n']['op1'], 'b', 2, persistent=False)
    ncs.assertEqual(len(ncs), 3)
    self.assertEqual(len(pcs), 3)

dataset/ETHPy150Open ImageEngine/gaffer/python/GafferTest/MetadataTest.py MetadataTest.testChangeOfPersistenceSignals/VarMisuse@260/376 `self`->`ncs`