Beispiel #1
0
 def test_inner_exception_preserved_in_retryrequest(self):
     try:
         exc = ValueError('test')
         with db_api.exc_to_retry(ValueError):
             raise exc
     except db_exc.RetryRequest as e:
         self.assertEqual(exc, e.inner_exc)
Beispiel #2
0
 def test_inner_exception_preserved_in_retryrequest(self):
     try:
         exc = ValueError('test')
         with db_api.exc_to_retry(ValueError):
             raise exc
     except db_exc.RetryRequest as e:
         self.assertEqual(exc, e.inner_exc)
Beispiel #3
0
 def test_retries_on_multi_exception_containing_target(self):
     with testtools.ExpectedException(db_exc.RetryRequest):
         with db_api.exc_to_retry(ValueError):
             e = exceptions.MultipleExceptions([ValueError(), TypeError()])
             raise e
Beispiel #4
0
 def test_passes_other_exceptions(self):
     with testtools.ExpectedException(ValueError):
         with db_api.exc_to_retry(TypeError):
             raise ValueError()
Beispiel #5
0
 def test_translates_multiple_exception_types(self):
     with testtools.ExpectedException(db_exc.RetryRequest):
         with db_api.exc_to_retry((ValueError, TypeError)):
             raise TypeError()
Beispiel #6
0
 def test_translates_single_exception(self):
     with testtools.ExpectedException(db_exc.RetryRequest):
         with db_api.exc_to_retry(ValueError):
             raise ValueError()
Beispiel #7
0
 def test_retries_on_multi_exception_containing_target(self):
     with testtools.ExpectedException(db_exc.RetryRequest):
         with db_api.exc_to_retry(ValueError):
             e = exceptions.MultipleExceptions([ValueError(), TypeError()])
             raise e
Beispiel #8
0
 def test_passes_other_exceptions(self):
     with testtools.ExpectedException(ValueError):
         with db_api.exc_to_retry(TypeError):
             raise ValueError()
Beispiel #9
0
 def test_translates_multiple_exception_types(self):
     with testtools.ExpectedException(db_exc.RetryRequest):
         with db_api.exc_to_retry((ValueError, TypeError)):
             raise TypeError()
Beispiel #10
0
 def test_translates_single_exception(self):
     with testtools.ExpectedException(db_exc.RetryRequest):
         with db_api.exc_to_retry(ValueError):
             raise ValueError()
Beispiel #11
0
 def test_translates_DBerror_inner_exception(self):
     with testtools.ExpectedException(db_exc.RetryRequest):
         with db_api.exc_to_retry(ValueError):
             raise db_exc.DBError(ValueError())