예제 #1
0
    def test_exception_class_names(self):
        # Create exception from class name
        error = FakeError('TooManyApplications', 400, 'foo', 'bar')
        exception = simple(error)
        self.assertEqual(exception.__class__.__name__, 'TooManyApplications')

        # Create exception from class name + 'Exception' as seen from the
        # live service today
        error = FakeError('TooManyApplicationsException', 400, 'foo', 'bar')
        exception = simple(error)
        self.assertEqual(exception.__class__.__name__, 'TooManyApplications')

        # Make sure message body is present
        self.assertEqual(exception.message, 'bar')
예제 #2
0
파일: test_exception.py 프로젝트: 10sr/hue
    def test_exception_class_names(self):
        # Create exception from class name
        error = FakeError('TooManyApplications', 400, 'foo', 'bar')
        exception = simple(error)
        self.assertEqual(exception.__class__.__name__, 'TooManyApplications')

        # Create exception from class name + 'Exception' as seen from the
        # live service today
        error = FakeError('TooManyApplicationsException', 400, 'foo', 'bar')
        exception = simple(error)
        self.assertEqual(exception.__class__.__name__, 'TooManyApplications')

        # Make sure message body is present
        self.assertEqual(exception.message, 'bar')
예제 #3
0
파일: wrapper.py 프로젝트: 10sr/hue
 def _wrapped_low_level_api(*args, **kwargs):
     try:
         response = func(*args, **kwargs)
     except BotoServerError as e:
         raise exception.simple(e)
     # Turn 'this_is_a_function_name' into 'ThisIsAFunctionNameResponse'.
     cls_name = ''.join([part.capitalize() for part in name.split('_')]) + 'Response'
     cls = getattr(boto.beanstalk.response, cls_name)
     return cls(response)
예제 #4
0
파일: wrapper.py 프로젝트: Rome84/AWS-BOTO1
 def _wrapped_low_level_api(*args, **kwargs):
     try:
         response = func(*args, **kwargs)
     except BotoServerError as e:
         raise exception.simple(e)
     # Turn 'this_is_a_function_name' into 'ThisIsAFunctionNameResponse'.
     cls_name = ''.join([part.capitalize()
                         for part in name.split('_')]) + 'Response'
     cls = getattr(boto.beanstalk.response, cls_name)
     return cls(response)
예제 #5
0
 def _wrapped_low_level_api(*args, **kwargs):
     try:
         response = func(*args, **kwargs)
     except BotoServerError, e:
         raise exception.simple(e)
예제 #6
0
파일: wrapper.py 프로젝트: 0t3dWCE/boto
 def _wrapped_low_level_api(*args, **kwargs):
     try:
         response = func(*args, **kwargs)
     except BotoServerError, e:
         raise exception.simple(e)