예제 #1
0
 def testFullStatusWithNoRefersTo(self):
     err = {
         'isFinalState': True,
         'status': {
             'isError': True,
             'description': {
                 'format': 'Raw Error'
             }
         }
     }
     self.assertEqual(transforms.TransformFullStatus(err),
                      'UNKNOWN_ERROR: Raw Error')
예제 #2
0
 def testFullStatusWithUnspecifiedError(self):
     err = {
         'isFinalState': True,
         'status': {
             'isError':
             True,
             'refersTo': (self.debug_messages.StatusMessage.
                          RefersToValueValuesEnum.UNSPECIFIED),
             'description': {
                 'format': 'Random Error'
             }
         }
     }
     self.assertEqual(transforms.TransformFullStatus(err),
                      'UNSPECIFIED_ERROR: Random Error')
예제 #3
0
 def testFullStatusWithSourceLocationError(self):
     err = {
         'isFinalState': True,
         'status': {
             'isError':
             True,
             'refersTo':
             (self.debug_messages.StatusMessage.RefersToValueValuesEnum.
              BREAKPOINT_SOURCE_LOCATION),
             'description': {
                 'format': 'Invalid location $0:$1',
                 'parameters': ['foo.py', '9999']
             }
         }
     }
     self.assertEqual(
         transforms.TransformFullStatus(err),
         'SOURCE_LOCATION_ERROR: Invalid location foo.py:9999')
예제 #4
0
 def testFullStatusWithBadKeyError(self):
     err = {
         'isFinalState': True,
         'status': {
             'isError':
             True,
             'refersTo':
             (self.debug_messages.StatusMessage.RefersToValueValuesEnum.
              BREAKPOINT_SOURCE_LOCATION),
             'description': {
                 'format': 'Bad format string {foo}',
                 'parameters': ['foo.py', '9999']
             }
         }
     }
     self.assertEqual(
         transforms.TransformFullStatus(err),
         'SOURCE_LOCATION_ERROR: Malformed status message: {0}'.format(
             err['status']))
예제 #5
0
 def testFullStatusNoError(self):
     err = {'isFinalState': True, 'status': {'isError': False}}
     self.assertEqual(transforms.TransformFullStatus(err), 'COMPLETED')
예제 #6
0
 def testFullStatusNoStatus(self):
     err = {'isFinalState': True}
     self.assertEqual(transforms.TransformFullStatus(err), 'COMPLETED')
예제 #7
0
 def testFullStatusNotFinal(self):
     err = {}
     self.assertEqual(transforms.TransformFullStatus(err), 'ACTIVE')