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
c52a0a74
Commit
c52a0a74
authored
Jul 12, 2016
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove handle*serials test funcs that are unused with IMultiCommitStorage.
parent
6fea7d8d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
46 deletions
+10
-46
src/ZODB/tests/BasicStorage.py
src/ZODB/tests/BasicStorage.py
+4
-8
src/ZODB/tests/MTStorage.py
src/ZODB/tests/MTStorage.py
+3
-8
src/ZODB/tests/RevisionStorage.py
src/ZODB/tests/RevisionStorage.py
+3
-7
src/ZODB/tests/StorageTestBase.py
src/ZODB/tests/StorageTestBase.py
+0
-23
No files found.
src/ZODB/tests/BasicStorage.py
View file @
c52a0a74
...
...
@@ -21,7 +21,6 @@ All storages should be able to pass these tests.
from
ZODB
import
POSException
from
ZODB.tests.MinPO
import
MinPO
from
ZODB.tests.StorageTestBase
import
zodb_unpickle
,
zodb_pickle
from
ZODB.tests.StorageTestBase
import
handle_serials
import
threading
import
time
...
...
@@ -68,13 +67,10 @@ class BasicStorage:
self
.
_storage
.
tpc_begin
(
txn
)
# Use None for serial. Don't use _dostore() here because that coerces
# serial=None to serial=ZERO.
r1
=
self
.
_storage
.
store
(
oid
,
None
,
zodb_pickle
(
MinPO
(
11
)),
''
,
txn
)
r2
=
self
.
_storage
.
tpc_vote
(
txn
)
serial
=
self
.
_storage
.
tpc_finish
(
txn
)
newrevid
=
handle_serials
(
oid
,
r1
,
r2
)
if
newrevid
is
None
and
serial
is
not
None
:
newrevid
=
serial
self
.
_storage
.
store
(
oid
,
None
,
zodb_pickle
(
MinPO
(
11
)),
''
,
txn
)
self
.
_storage
.
tpc_vote
(
txn
)
newrevid
=
self
.
_storage
.
tpc_finish
(
txn
)
data
,
revid
=
utils
.
load_current
(
self
.
_storage
,
oid
)
value
=
zodb_unpickle
(
data
)
eq
(
value
,
MinPO
(
11
))
...
...
src/ZODB/tests/MTStorage.py
View file @
c52a0a74
...
...
@@ -9,7 +9,6 @@ import transaction
import
ZODB
from
ZODB.tests.StorageTestBase
import
zodb_pickle
,
zodb_unpickle
from
ZODB.tests.StorageTestBase
import
handle_serials
from
ZODB.tests.MinPO
import
MinPO
from
ZODB.POSException
import
ConflictError
...
...
@@ -149,18 +148,14 @@ class StorageClientThread(TestThread):
self
.
pause
()
# Always create a new object, signified by None for revid
r1
=
self
.
storage
.
store
(
oid
,
None
,
data
,
''
,
t
)
self
.
storage
.
store
(
oid
,
None
,
data
,
''
,
t
)
self
.
pause
()
r2
=
self
.
storage
.
tpc_vote
(
t
)
self
.
storage
.
tpc_vote
(
t
)
self
.
pause
()
serial
=
self
.
storage
.
tpc_finish
(
t
)
revid
=
self
.
storage
.
tpc_finish
(
t
)
self
.
pause
()
revid
=
handle_serials
(
oid
,
r1
,
r2
)
if
serial
is
not
None
and
revid
is
None
:
revid
=
serial
self
.
oids
[
oid
]
=
revid
class
ExtStorageClientThread
(
StorageClientThread
):
...
...
src/ZODB/tests/RevisionStorage.py
View file @
c52a0a74
...
...
@@ -15,7 +15,6 @@
from
ZODB.tests.MinPO
import
MinPO
from
ZODB.tests.StorageTestBase
import
zodb_unpickle
,
zodb_pickle
,
snooze
from
ZODB.tests.StorageTestBase
import
handle_serials
from
ZODB.utils
import
p64
,
u64
,
load_current
import
transaction
...
...
@@ -146,16 +145,13 @@ class RevisionStorage:
t
=
transaction
.
Transaction
()
try
:
self
.
_storage
.
tpc_begin
(
t
,
p64
(
tid
))
r1
=
self
.
_storage
.
store
(
oid
,
revid
,
data
,
''
,
t
)
self
.
_storage
.
store
(
oid
,
revid
,
data
,
''
,
t
)
# Finish the transaction
r2
=
self
.
_storage
.
tpc_vote
(
t
)
newrevid
=
handle_serials
(
oid
,
r1
,
r2
)
serial
=
self
.
_storage
.
tpc_finish
(
t
)
self
.
_storage
.
tpc_vote
(
t
)
newrevid
=
self
.
_storage
.
tpc_finish
(
t
)
except
:
self
.
_storage
.
tpc_abort
(
t
)
raise
if
serial
is
not
None
and
newrevid
is
None
:
newrevid
=
serial
return
newrevid
revid1
=
helper
(
1
,
None
,
1
)
revid2
=
helper
(
2
,
revid1
,
2
)
...
...
src/ZODB/tests/StorageTestBase.py
View file @
c52a0a74
...
...
@@ -101,29 +101,6 @@ def zodb_unpickle(data):
inst
.
__setstate__
(
state
)
return
inst
def
handle_all_serials
(
oid
,
*
args
):
"""
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
=
{}
# On empty dict, _dostore will choose the serial returned from
# 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
)
def
import_helper
(
name
):
__import__
(
name
)
return
sys
.
modules
[
name
]
...
...
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