

def testBadSlotsDontAffectGoodSlots(self):

    def badSlot(nodeTypeId, key, node):
        raise Exception('Oops')
    self.__goodSlotExecuted = False

    def goodSlot(nodeTypeId, key, node):
        self.__goodSlotExecuted = True
    badConnection = Gaffer.Metadata.nodeValueChangedSignal().connect(badSlot)
    goodConnection = Gaffer.Metadata.nodeValueChangedSignal().connect(goodSlot)
    n = Gaffer.Node()
    with IECore.CapturingMessageHandler() as mh:
        Gaffer.Metadata.registerNodeValue(n, 'test', 10)
    self.assertTrue(self.__goodSlotExecuted)
    self.assertEqual(len(mh.messages), 1)
    self.assertTrue(('Oops' in mh.messages[0].message))

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