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
ddcac845
Commit
ddcac845
authored
Jan 24, 2002
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkVersionIterator() provokes a failure in FileStorage.
XXX checkTransactionalUndoIterator() should too, but doesn't.
parent
7ed92e53
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
4 deletions
+64
-4
src/ZODB/tests/IteratorStorage.py
src/ZODB/tests/IteratorStorage.py
+64
-4
No files found.
src/ZODB/tests/IteratorStorage.py
View file @
ddcac845
...
...
@@ -7,7 +7,7 @@ all these tests.
from
ZODB.tests.MinPO
import
MinPO
from
ZODB.tests.StorageTestBase
import
zodb_unpickle
from
ZODB.utils
import
U64
,
p64
from
ZODB.Transaction
import
Transaction
class
IteratorCompare
:
...
...
@@ -26,9 +26,6 @@ class IteratorCompare:
val
=
val
+
1
eq
(
val
,
val0
+
len
(
revids
))
# XXX need a test case that covers iteration over a storage that
# includes a transactional undo that un-created an object.
class
IteratorStorage
(
IteratorCompare
):
def
checkSimpleIteration
(
self
):
...
...
@@ -41,6 +38,69 @@ class IteratorStorage(IteratorCompare):
txniter
=
self
.
_storage
.
iterator
()
self
.
iter_verify
(
txniter
,
[
revid1
,
revid2
,
revid3
],
11
)
def
checkVersionIterator
(
self
):
if
not
self
.
_storage
.
supportsVersions
():
return
self
.
_dostore
()
self
.
_dostore
(
version
=
'abort'
)
self
.
_dostore
()
self
.
_dostore
(
version
=
'abort'
)
t
=
Transaction
()
self
.
_storage
.
tpc_begin
(
t
)
self
.
_storage
.
abortVersion
(
'abort'
,
t
)
self
.
_storage
.
tpc_vote
(
t
)
self
.
_storage
.
tpc_finish
(
t
)
self
.
_dostore
(
version
=
'commit'
)
self
.
_dostore
()
self
.
_dostore
(
version
=
'commit'
)
t
=
Transaction
()
self
.
_storage
.
tpc_begin
(
t
)
self
.
_storage
.
commitVersion
(
'commit'
,
''
,
t
)
self
.
_storage
.
tpc_vote
(
t
)
self
.
_storage
.
tpc_finish
(
t
)
# XXX extend these checks. right now, just iterating with CVS
# FS or Berkeley will fail here, but once fixed we should
# check that the right data is returned.
txniter
=
self
.
_storage
.
iterator
()
for
trans
in
txniter
:
for
data
in
trans
:
pass
def
checkTransactionalUndoIterator
(
self
):
if
not
hasattr
(
self
.
_storage
,
'supportsTransactionalUndo'
):
return
if
not
self
.
_storage
.
supportsTransactionalUndo
():
return
oid
=
self
.
_storage
.
new_oid
()
revid
=
self
.
_dostore
(
oid
)
self
.
_dostore
(
oid
,
revid
)
self
.
undoLastTrans
()
self
.
undoLastTrans
()
# XXX extend these checks. right now, just iterating with CVS
# FS or Berkeley will fail here, but once fixed we should
# check that the right data is returned.
txniter
=
self
.
_storage
.
iterator
()
for
trans
in
txniter
:
for
data
in
trans
:
print
repr
(
data
.
oid
),
repr
(
data
.
data
)
def
undoLastTrans
(
self
):
info
=
self
.
_storage
.
undoInfo
()
print
len
(
info
)
tid
=
info
[
0
][
'id'
]
t
=
Transaction
()
self
.
_storage
.
tpc_begin
(
t
)
oids
=
self
.
_storage
.
transactionalUndo
(
tid
,
t
)
self
.
_storage
.
tpc_vote
(
t
)
self
.
_storage
.
tpc_finish
(
t
)
class
ExtendedIteratorStorage
(
IteratorCompare
):
def
checkExtendedIteration
(
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