Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZODB
Commits
c75a197d
Commit
c75a197d
authored
Apr 02, 2018
by
Matthew Wilkes
Committed by
Jim Fulton
Apr 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix infinite recursion when copying from a MappingStorage to a FileStorage (#199)
parent
a6bedf8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
+31
-4
src/ZODB/MappingStorage.py
src/ZODB/MappingStorage.py
+2
-2
src/ZODB/tests/testMappingStorage.py
src/ZODB/tests/testMappingStorage.py
+29
-2
No files found.
src/ZODB/MappingStorage.py
View file @
c75a197d
...
...
@@ -344,8 +344,8 @@ class TransactionRecord(object):
self
.
extension
=
extension
self
.
data
=
data
_extension
=
property
(
lambda
self
:
self
.
_
extension
,
lambda
self
,
v
:
setattr
(
self
,
'
_
extension'
,
v
),
_extension
=
property
(
lambda
self
:
self
.
extension
,
lambda
self
,
v
:
setattr
(
self
,
'extension'
,
v
),
)
def
__iter__
(
self
):
...
...
src/ZODB/tests/testMappingStorage.py
View file @
c75a197d
...
...
@@ -11,6 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
from
collections
import
namedtuple
import
ZODB.MappingStorage
import
unittest
import
ZODB.tests.hexstorage
...
...
@@ -61,9 +62,35 @@ class MappingStorageHexTests(MappingStorageTests):
self
.
_storage
=
ZODB
.
tests
.
hexstorage
.
HexStorage
(
ZODB
.
MappingStorage
.
MappingStorage
())
MockTransaction
=
namedtuple
(
'transaction'
,
[
'user'
,
'description'
,
'extension'
]
)
class
MappingStorageTransactionRecordTests
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
_transaction_record
=
ZODB
.
MappingStorage
.
TransactionRecord
(
0
,
MockTransaction
(
'user'
,
'description'
,
'extension'
),
''
)
def
check_set__extension
(
self
):
self
.
_transaction_record
.
_extension
=
'new'
self
.
assertEqual
(
self
.
_transaction_record
.
extension
,
'new'
)
def
check_get__extension
(
self
):
self
.
assertEqual
(
self
.
_transaction_record
.
extension
,
self
.
_transaction_record
.
_extension
)
def
test_suite
():
suite
=
unittest
.
makeSuite
(
MappingStorageTests
,
'check'
)
suite
=
unittest
.
makeSuite
(
MappingStorageHexTests
,
'check'
)
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
MappingStorageTests
,
'check'
))
suite
.
addTest
(
unittest
.
makeSuite
(
MappingStorageHexTests
,
'check'
))
suite
.
addTest
(
unittest
.
makeSuite
(
MappingStorageTransactionRecordTests
,
'check'
))
return
suite
if
__name__
==
"__main__"
:
...
...
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