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
5b4e7a2d
Commit
5b4e7a2d
authored
Dec 17, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coverage for TransactionManager.{register,unregister}Synch.
parent
852e06df
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
transaction/tests/test__manager.py
transaction/tests/test__manager.py
+23
-0
No files found.
transaction/tests/test__manager.py
View file @
5b4e7a2d
...
...
@@ -31,6 +31,11 @@ class TransactionManagerTests(unittest.TestCase):
nosub1
=
DataObject
(
mgr
,
nost
=
1
)
return
mgr
,
sub1
,
sub2
,
sub3
,
nosub1
def
test_ctor
(
self
):
tm
=
self
.
_makeOne
()
self
.
assertTrue
(
tm
.
_txn
is
None
)
self
.
assertEqual
(
len
(
tm
.
_synchs
),
0
)
def
test_begin_wo_existing_txn_wo_synchs
(
self
):
from
transaction._transaction
import
Transaction
tm
=
self
.
_makeOne
()
...
...
@@ -89,6 +94,24 @@ class TransactionManagerTests(unittest.TestCase):
tm
.
free
(
txn
)
self
.
assertTrue
(
tm
.
_txn
is
None
)
def
test_registerSynch
(
self
):
tm
=
self
.
_makeOne
()
synch
=
DummySynch
()
tm
.
registerSynch
(
synch
)
self
.
assertEqual
(
len
(
tm
.
_synchs
),
1
)
self
.
assertTrue
(
synch
in
tm
.
_synchs
)
def
test_unregisterSynch
(
self
):
tm
=
self
.
_makeOne
()
synch1
=
DummySynch
()
synch2
=
DummySynch
()
tm
.
registerSynch
(
synch1
)
tm
.
registerSynch
(
synch2
)
tm
.
unregisterSynch
(
synch1
)
self
.
assertEqual
(
len
(
tm
.
_synchs
),
1
)
self
.
assertFalse
(
synch1
in
tm
.
_synchs
)
self
.
assertTrue
(
synch2
in
tm
.
_synchs
)
# basic tests with two sub trans jars
# really we only need one, so tests for
# 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