Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
a2b3f6f6
Commit
a2b3f6f6
authored
May 08, 2001
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache tests from ZEO2 branch
parent
03cf4b6b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
+66
-0
src/ZEO/tests/Cache.py
src/ZEO/tests/Cache.py
+66
-0
No files found.
src/ZEO/tests/Cache.py
0 → 100644
View file @
a2b3f6f6
"""Tests of the ZEO cache"""
from
ZODB.Transaction
import
Transaction
from
ZODB.tests.MinPO
import
MinPO
from
ZODB.tests.StorageTestBase
import
zodb_unpickle
class
TransUndoStorageWithCache
:
def
checkUndoInvalidation
(
self
):
oid
=
self
.
_storage
.
new_oid
()
revid
=
self
.
_dostore
(
oid
,
data
=
MinPO
(
23
))
revid
=
self
.
_dostore
(
oid
,
revid
=
revid
,
data
=
MinPO
(
24
))
revid
=
self
.
_dostore
(
oid
,
revid
=
revid
,
data
=
MinPO
(
25
))
info
=
self
.
_storage
.
undoInfo
()
tid
=
info
[
0
][
'id'
]
# Now start an undo transaction
self
.
_transaction
.
note
(
'undo1'
)
self
.
_storage
.
tpc_begin
(
self
.
_transaction
)
oids
=
self
.
_storage
.
transactionalUndo
(
tid
,
self
.
_transaction
)
# Make sure this doesn't load invalid data into the cache
self
.
_storage
.
load
(
oid
,
''
)
self
.
_storage
.
tpc_vote
(
self
.
_transaction
)
self
.
_storage
.
tpc_finish
(
self
.
_transaction
)
assert
len
(
oids
)
==
1
assert
oids
[
0
]
==
oid
data
,
revid
=
self
.
_storage
.
load
(
oid
,
''
)
obj
=
zodb_unpickle
(
data
)
assert
obj
==
MinPO
(
24
)
class
StorageWithCache
:
def
checkAbortVersionInvalidation
(
self
):
oid
=
self
.
_storage
.
new_oid
()
revid
=
self
.
_dostore
(
oid
,
data
=
MinPO
(
1
))
revid
=
self
.
_dostore
(
oid
,
revid
=
revid
,
data
=
MinPO
(
2
))
revid
=
self
.
_dostore
(
oid
,
revid
=
revid
,
data
=
MinPO
(
3
),
version
=
"foo"
)
revid
=
self
.
_dostore
(
oid
,
revid
=
revid
,
data
=
MinPO
(
4
),
version
=
"foo"
)
t
=
Transaction
()
self
.
_storage
.
tpc_begin
(
t
)
self
.
_storage
.
abortVersion
(
"foo"
,
t
)
self
.
_storage
.
load
(
oid
,
"foo"
)
self
.
_storage
.
tpc_vote
(
t
)
self
.
_storage
.
tpc_finish
(
t
)
data
,
revid
=
self
.
_storage
.
load
(
oid
,
"foo"
)
obj
=
zodb_unpickle
(
data
)
assert
obj
==
MinPO
(
2
),
obj
def
checkCommitVersionInvalidation
(
self
):
oid
=
self
.
_storage
.
new_oid
()
revid
=
self
.
_dostore
(
oid
,
data
=
MinPO
(
1
))
revid
=
self
.
_dostore
(
oid
,
revid
=
revid
,
data
=
MinPO
(
2
))
revid
=
self
.
_dostore
(
oid
,
revid
=
revid
,
data
=
MinPO
(
3
),
version
=
"foo"
)
t
=
Transaction
()
self
.
_storage
.
tpc_begin
(
t
)
self
.
_storage
.
commitVersion
(
"foo"
,
""
,
t
)
self
.
_storage
.
load
(
oid
,
""
)
self
.
_storage
.
tpc_vote
(
t
)
self
.
_storage
.
tpc_finish
(
t
)
data
,
revid
=
self
.
_storage
.
load
(
oid
,
""
)
obj
=
zodb_unpickle
(
data
)
assert
obj
==
MinPO
(
3
),
obj
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