

def testLoadThrowsExceptionsOnError(self):
    s = Gaffer.ScriptNode()
    s['b'] = Gaffer.Box()
    s['b']['n'] = GafferTest.SphereNode()
    s['b'].exportForReference('/tmp/test.grf')
    del GafferTest.SphereNode
    s2 = Gaffer.ScriptNode()
    mh['r'] = Gaffer.Reference()
    with IECore.CapturingMessageHandler() as mh:
        self.assertRaises(Exception, s2['r'].load, '/tmp/test.grf')
    self.assertEqual(len(mh.messages), 2)
    self.assertTrue(("has no attribute 'SphereNode'" in mh.messages[0].message))
    self.assertTrue(("KeyError: 'n'" in mh.messages[1].message))

dataset/ETHPy150Open ImageEngine/gaffer/python/GafferTest/ReferenceTest.py ReferenceTest.testLoadThrowsExceptionsOnError/VarMisuse@66/108 `s2`->`mh`