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
665f559a
Commit
665f559a
authored
Nov 16, 2016
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement excellent reviewer suggestions
parent
32bd5a7a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
transaction/_manager.py
transaction/_manager.py
+4
-3
transaction/_transaction.py
transaction/_transaction.py
+1
-1
transaction/tests/test__transaction.py
transaction/tests/test__transaction.py
+5
-5
No files found.
transaction/_manager.py
View file @
665f559a
...
...
@@ -175,15 +175,16 @@ class TransactionManager(object):
doc
=
func
.
__doc__
if
name
!=
'_'
:
if
doc
:
doc
=
name
+
u
'
\
n
\
n
'
+
doc
doc
=
name
+
'
\
n
\
n
'
+
doc
else
:
doc
=
name
if
doc
and
not
isinstance
(
doc
,
text_type
):
doc
=
doc
.
decode
(
'utf-8'
)
for
i
in
range
(
1
,
tries
+
1
):
txn
=
self
.
begin
()
if
doc
:
if
not
isinstance
(
doc
,
text_type
):
doc
=
doc
.
decode
(
'ascii'
)
txn
.
note
(
doc
)
try
:
...
...
transaction/_transaction.py
View file @
665f559a
...
...
@@ -548,7 +548,7 @@ class Transaction(object):
if
not
isinstance
(
user_name
,
text_type
):
raise
TypeError
(
"User name must be text (unicode)"
)
if
not
isinstance
(
path
,
text_type
):
raise
TypeError
(
"
User name
must be text (unicode)"
)
raise
TypeError
(
"
Path
must be text (unicode)"
)
self
.
user
=
u"%s %s"
%
(
path
,
user_name
)
def
setExtendedInfo
(
self
,
name
,
value
):
...
...
transaction/tests/test__transaction.py
View file @
665f559a
...
...
@@ -992,7 +992,7 @@ class TransactionTests(unittest.TestCase):
def
test_description_bytes
(
self
):
txn
=
self
.
_makeOne
()
with
self
.
assertRaises
(
(
UnicodeDecodeError
,
TypeError
)
):
with
self
.
assertRaises
(
TypeError
):
txn
.
description
=
b'haha'
def
test_setUser_default_path
(
self
):
...
...
@@ -1007,13 +1007,13 @@ class TransactionTests(unittest.TestCase):
def
test_user_bytes
(
self
):
txn
=
self
.
_makeOne
()
with
self
.
assertRaises
(
(
UnicodeDecodeError
,
TypeError
)
):
with
self
.
assertRaises
(
TypeError
):
txn
.
user
=
b'phreddy'
with
self
.
assertRaises
(
(
UnicodeDecodeError
,
TypeError
)
):
with
self
.
assertRaises
(
TypeError
):
txn
.
setUser
(
b'phreddy'
,
u'/bedrock'
)
with
self
.
assertRaises
(
(
UnicodeDecodeError
,
TypeError
)
):
with
self
.
assertRaises
(
TypeError
):
txn
.
setUser
(
u'phreddy'
,
b'/bedrock'
)
with
self
.
assertRaises
(
(
UnicodeDecodeError
,
TypeError
)
):
with
self
.
assertRaises
(
TypeError
):
txn
.
setUser
(
b'phreddy'
)
def
test_setExtendedInfo_single
(
self
):
...
...
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