def testLoadThrowsExceptionsOnError( self ) :

		s = Gaffer.ScriptNode()
		s["b"] = Gaffer.Box()
		s["b"]["n"] = GafferTest.SphereNode()

		s["b"].exportForReference( "/tmp/test.grf" )

		del GafferTest.SphereNode # induce a failure during loading

		s2 = Gaffer.ScriptNode()
		s2["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'" <= mh.messages[1].message )
dataset/ETHPy150Open ImageEngine/gaffer/python/GafferTest/ReferenceTest.py/ReferenceTest.testLoadThrowsExceptionsOnError/operator `in` -> `<=`