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
2b15f06b
Commit
2b15f06b
authored
May 08, 2003
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove variant copy testTransactionalUndoIterator that depended on
ZODB4.
parent
040dc5a2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
89 deletions
+0
-89
src/ZODB/tests/TransactionalUndoStorage.py
src/ZODB/tests/TransactionalUndoStorage.py
+0
-89
No files found.
src/ZODB/tests/TransactionalUndoStorage.py
View file @
2b15f06b
...
...
@@ -659,95 +659,6 @@ class TransactionalUndoStorage:
self
.
assertEqual
(
rt
[
"test"
].
value
,
3
)
self
.
assertEqual
(
rt
[
"test2"
].
value
,
2
)
def
testTransactionalUndoIterator
(
self
):
# check that data_txn set in iterator makes sense
if
not
hasattr
(
self
.
_storage
,
"iterator"
):
return
s
=
self
.
_storage
BATCHES
=
4
OBJECTS
=
4
orig
=
[]
for
i
in
range
(
BATCHES
):
t
=
Transaction
()
tid
=
p64
(
i
+
1
)
s
.
tpcBegin
(
t
,
tid
)
for
j
in
range
(
OBJECTS
):
oid
=
s
.
newObjectId
()
obj
=
MinPO
(
i
*
OBJECTS
+
j
)
data
,
refs
=
zodb_pickle
(
obj
)
revid
=
s
.
store
(
oid
,
None
,
data
,
refs
,
''
,
t
)
orig
.
append
((
tid
,
oid
,
revid
))
s
.
tpcVote
(
t
)
s
.
tpcFinish
(
t
)
i
=
0
for
tid
,
oid
,
revid
in
orig
:
self
.
_dostore
(
oid
,
revid
=
revid
,
data
=
MinPO
(
revid
),
description
=
"update %s"
%
i
)
# Undo the OBJECTS transactions that modified objects created
# in the ith original transaction.
def
undo
(
i
):
info
=
s
.
undoInfo
()
t
=
Transaction
()
s
.
tpcBegin
(
t
)
base
=
i
*
OBJECTS
+
i
for
j
in
range
(
OBJECTS
):
tid
=
info
[
base
+
j
][
'id'
]
s
.
undo
(
tid
,
t
)
s
.
tpcVote
(
t
)
s
.
tpcFinish
(
t
)
for
i
in
range
(
BATCHES
):
undo
(
i
)
# There are now (2 + OBJECTS) * BATCHES transactions:
# BATCHES original transactions, followed by
# OBJECTS * BATCHES modifications, followed by
# BATCHES undos
fsiter
=
iter
(
s
.
iterator
())
offset
=
0
eq
=
self
.
assertEqual
for
i
in
range
(
BATCHES
):
txn
=
fsiter
.
next
()
offset
+=
1
tid
=
p64
(
i
+
1
)
eq
(
txn
.
tid
,
tid
)
L1
=
[(
rec
.
oid
,
rec
.
serial
,
rec
.
data_txn
)
for
rec
in
txn
]
L2
=
[(
oid
,
revid
,
None
)
for
_tid
,
oid
,
revid
in
orig
if
_tid
==
tid
]
eq
(
L1
,
L2
)
for
i
in
range
(
BATCHES
*
OBJECTS
):
txn
=
fsiter
.
next
()
offset
+=
1
eq
(
len
([
rec
for
rec
in
txn
if
rec
.
data_txn
is
None
]),
1
)
for
i
in
range
(
BATCHES
):
txn
=
fsiter
.
next
()
offset
+=
1
# The undos are performed in reverse order.
otid
=
p64
(
BATCHES
-
i
)
L1
=
[(
rec
.
oid
,
rec
.
data_txn
)
for
rec
in
txn
]
L2
=
[(
oid
,
otid
)
for
_tid
,
oid
,
revid
in
orig
if
_tid
==
otid
]
L1
.
sort
()
L2
.
sort
()
eq
(
L1
,
L2
)
self
.
assertRaises
(
StopIteration
,
fsiter
.
next
)
def
checkTransactionalUndoIterator
(
self
):
# check that data_txn set in iterator makes sense
if
not
hasattr
(
self
.
_storage
,
"iterator"
):
...
...
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