Example #1
0
 def test_object_initialization_nocreate_notraceorprevious(self):
     """ACSError initialized without create and no trace or previous error"""
     try:
         raise Exception("ACSError Test Exception")
     except Exception, e:
         er = Err.ACSError(0, 0, exception=5, create=0)
         self.assertEqual(False, hasattr(er, 'errorTrace'))
Example #2
0
 def setUp(self):
     self.logger = mock.Mock(spec=Logger)
     self.original = sys.stdout
     sys.stdout = mock.Mock(spec=sys.stdout)
     er = Err.ACSError(0, 0)
     self.cpl = ACSErr.Completion(0, 0, 0, [er.getErrorTrace()])
     Err.addComplHelperMethods(self.cpl)
Example #3
0
 def test_object_initialization_CORBA_Exception(self):
     """ACSError initialized from CORBA Exception"""
     try:
         raise Exception("ACSError Test Exception")
     except Exception, e:
         cex = Err.pyExceptionToCORBA(e)
         er = Err.ACSError(0, 0, exception=cex, create=0)
         self.assertEqual(er.errorTrace, cex.errorTrace)
Example #4
0
 def test_object_initialization_Completion(self):
     """ACSError initialized from Completion"""
     cpl = ACSErr.Completion(0, 0, 0, [0])
     er = Err.ACSError(0, 0, exception=cpl, create=0)
     self.assertEqual(cpl.previousError[0], er.errorTrace)
Example #5
0
 def test_object_initialization(self):
     """ACSError initialized with defaults"""
     er = Err.ACSError(0, 0)
     self.assertEqual(True, isinstance(er.errorTrace, Err.ErrorTrace))
Example #6
0
 def test_getErrorTrace(self):
     """ACSError getErrorTrace returns trace when defined"""
     er = Err.ACSError(0, 0)
     self.assertEqual(True, isinstance(er.errorTrace, Err.ErrorTrace))
Example #7
0
 def test_getErrorTrace_notrace(self):
     """ACSError getErrorTrace returns expected value when no trace defined"""
     er = Err.ACSError(0, 0, create=0)
     self.assertEqual(True, er.getErrorTrace() is None)