[Checkins] SVN: transaction/branches/sphinx/ Coverage for TransactionManager._retryable.
Tres Seaver
cvs-admin at zope.org
Mon Dec 17 22:09:14 UTC 2012
Log message for revision 128726:
Coverage for TransactionManager._retryable.
Changed:
_U transaction/branches/sphinx/
U transaction/branches/sphinx/transaction/tests/test__manager.py
-=-
Modified: transaction/branches/sphinx/transaction/tests/test__manager.py
===================================================================
--- transaction/branches/sphinx/transaction/tests/test__manager.py 2012-12-17 22:09:14 UTC (rev 128725)
+++ transaction/branches/sphinx/transaction/tests/test__manager.py 2012-12-17 22:09:14 UTC (rev 128726)
@@ -231,6 +231,30 @@
self.assertTrue(attempt.manager is tm)
self.assertTrue(found[-1] is tm)
+ def test__retryable_w_transient_error(self):
+ from transaction.interfaces import TransientError
+ tm = self._makeOne()
+ self.assertTrue(tm._retryable(TransientError, object()))
+
+ def test__retryable_w_transient_subclass(self):
+ from transaction.interfaces import TransientError
+ class _Derived(TransientError):
+ pass
+ tm = self._makeOne()
+ self.assertTrue(tm._retryable(_Derived, object()))
+
+ def test__retryable_w_normal_exception_no_resources(self):
+ tm = self._makeOne()
+ self.assertFalse(tm._retryable(Exception, object()))
+
+ def test__retryable_w_normal_exception_w_resource_voting_yes(self):
+ class _Resource(object):
+ def should_retry(self, err):
+ return True
+ tm = self._makeOne()
+ tm.get()._resources.append(_Resource())
+ self.assertTrue(tm._retryable(Exception, object()))
+
# basic tests with two sub trans jars
# really we only need one, so tests for
# sub1 should identical to tests for sub2
More information about the checkins
mailing list