Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
transaction
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
transaction
Commits
2b7807ca
Commit
2b7807ca
authored
Dec 17, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coverage for TransactionManager._retryable.
parent
d788cea5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
transaction/tests/test__manager.py
transaction/tests/test__manager.py
+24
-0
No files found.
transaction/tests/test__manager.py
View file @
2b7807ca
...
@@ -231,6 +231,30 @@ class TransactionManagerTests(unittest.TestCase):
...
@@ -231,6 +231,30 @@ class TransactionManagerTests(unittest.TestCase):
self
.
assertTrue
(
attempt
.
manager
is
tm
)
self
.
assertTrue
(
attempt
.
manager
is
tm
)
self
.
assertTrue
(
found
[
-
1
]
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
# basic tests with two sub trans jars
# really we only need one, so tests for
# really we only need one, so tests for
# sub1 should identical to tests for sub2
# sub1 should identical to tests for sub2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment