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
46985225
Commit
46985225
authored
Dec 18, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coverage for Transaction.{setUser,setExtendedInfo}.
parent
f1ac2d88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
transaction/tests/test__transaction.py
transaction/tests/test__transaction.py
+24
-0
No files found.
transaction/tests/test__transaction.py
View file @
46985225
...
...
@@ -59,6 +59,8 @@ class TransactionTests(unittest.TestCase):
self
.
assertTrue
(
isinstance
(
txn
.
_synchronizers
,
WeakSet
))
self
.
assertEqual
(
len
(
txn
.
_synchronizers
),
0
)
self
.
assertTrue
(
txn
.
_manager
is
None
)
self
.
assertEqual
(
txn
.
user
,
""
)
self
.
assertEqual
(
txn
.
description
,
""
)
self
.
assertTrue
(
txn
.
_savepoint2index
is
None
)
self
.
assertEqual
(
txn
.
_savepoint_index
,
0
)
self
.
assertEqual
(
txn
.
_resources
,
[])
...
...
@@ -920,6 +922,28 @@ class TransactionTests(unittest.TestCase):
finally
:
txn
.
abort
()
def
test_setUser_default_path
(
self
):
txn
=
self
.
_makeOne
()
txn
.
setUser
(
'phreddy'
)
self
.
assertEqual
(
txn
.
user
,
'/ phreddy'
)
def
test_setUser_explicit_path
(
self
):
txn
=
self
.
_makeOne
()
txn
.
setUser
(
'phreddy'
,
'/bedrock'
)
self
.
assertEqual
(
txn
.
user
,
'/bedrock phreddy'
)
def
test_setExtendedInfo_single
(
self
):
txn
=
self
.
_makeOne
()
txn
.
setExtendedInfo
(
'frob'
,
'qux'
)
self
.
assertEqual
(
txn
.
_extension
,
{
'frob'
:
'qux'
})
def
test_setExtendedInfo_multiple
(
self
):
txn
=
self
.
_makeOne
()
txn
.
setExtendedInfo
(
'frob'
,
'qux'
)
txn
.
setExtendedInfo
(
'baz'
,
'spam'
)
txn
.
setExtendedInfo
(
'frob'
,
'quxxxx'
)
self
.
assertEqual
(
txn
.
_extension
,
{
'frob'
:
'quxxxx'
,
'baz'
:
'spam'
})
class
Test_oid_repr
(
unittest
.
TestCase
):
...
...
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