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
Kirill Smelkov
ZODB
Commits
71b6239d
Commit
71b6239d
authored
Jul 09, 2016
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Per @jimfulton, handle_all_serials shouldn't be sniffying in ZODB5, so try that.
parent
f5f670c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
26 deletions
+10
-26
src/ZODB/tests/StorageTestBase.py
src/ZODB/tests/StorageTestBase.py
+10
-26
No files found.
src/ZODB/tests/StorageTestBase.py
View file @
71b6239d
...
...
@@ -102,41 +102,28 @@ def zodb_unpickle(data):
return
inst
def
handle_all_serials
(
oid
,
*
args
):
"""Return dict of oid to serialno from store() and tpc_vote().
Raises an exception if one of the calls raised an exception.
The storage interface got complicated when ZEO was introduced.
Any individual store() call can return None or a sequence of
2-tuples where the 2-tuple is either oid, serialno or an
exception to be raised by the client.
The original interface just returned the serialno for the
object.
"""
Return dict of oid to serialno from store() and tpc_vote().
The updated multi-commit API returns nothing from store(), and
returns a sequence of resolved oids from tpc_vote.
This is pointless with IMultiCommitStorage.
"""
d
=
{}
for
arg
in
args
:
if
isinstance
(
arg
,
bytes
):
d
[
oid
]
=
arg
elif
arg
:
if
arg
:
# store() will have passed us None
for
t
in
arg
:
if
isinstance
(
t
,
bytes
):
# This will be the tid returned by tpc_finish.
pass
else
:
oid
,
serial
=
t
if
not
isinstance
(
serial
,
bytes
):
raise
serial
# error from ZEO server
d
[
oid
]
=
serial
assert
isinstance
(
t
,
bytes
)
# This will be the tid returned by tpc_finish.
return
d
def
handle_serials
(
oid
,
*
args
):
"""Return the serialno for oid based on multiple return values.
A helper for function _handle_all_serials().
This is pointless with IMultiCommitStorage.
"""
return
handle_all_serials
(
oid
,
*
args
).
get
(
oid
)
...
...
@@ -194,10 +181,7 @@ class StorageTestBase(ZODB.tests.util.TestCase):
r1
=
self
.
_storage
.
store
(
oid
,
revid
,
data
,
''
,
t
)
# Finish the transaction
r2
=
self
.
_storage
.
tpc_vote
(
t
)
revid
=
handle_serials
(
oid
,
r1
,
r2
)
serial
=
self
.
_storage
.
tpc_finish
(
t
)
if
serial
is
not
None
and
revid
is
None
:
revid
=
serial
revid
=
self
.
_storage
.
tpc_finish
(
t
)
except
:
self
.
_storage
.
tpc_abort
(
t
)
raise
...
...
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