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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZEO
Commits
2c55ef91
Commit
2c55ef91
authored
Apr 07, 2003
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sync tests with current cache impl.
parent
bf64fad2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
src/ZODB/tests/testCache.py
src/ZODB/tests/testCache.py
+20
-10
No files found.
src/ZODB/tests/testCache.py
View file @
2c55ef91
...
...
@@ -180,9 +180,14 @@ class LRUCacheTests(CacheTestBase):
for
i
in
range
(
CONNS
):
self
.
noodle_new_connection
()
# The DB cacheSize() method returns the number of non-ghost
# objects, which should be zero.
self
.
assertEquals
(
self
.
db
.
cacheSize
(),
0
)
self
.
assertEquals
(
self
.
db
.
cacheSize
(),
CACHE_SIZE
*
CONNS
)
details
=
self
.
db
.
cacheDetailSize
()
self
.
assertEquals
(
len
(
details
),
CONNS
)
for
d
in
details
:
self
.
assertEquals
(
d
[
'ngsize'
],
CACHE_SIZE
)
# the root is also in the cache as ghost, because
# the connection holds a reference to it
self
.
assertEquals
(
d
[
'size'
],
CACHE_SIZE
+
1
)
def
checkDetail
(
self
):
CACHE_SIZE
=
10
...
...
@@ -192,15 +197,20 @@ class LRUCacheTests(CacheTestBase):
for
i
in
range
(
CONNS
):
self
.
noodle_new_connection
()
# the only thing in the cache is the root objects,
# which are referenced explicitly by the connection.
[(
klass
,
count
)]
=
self
.
db
.
cacheDetail
()
self
.
assertEqual
(
klass
,
"Persistence.PersistentMapping"
)
self
.
assertEqual
(
count
,
CONNS
)
for
klass
,
count
in
self
.
db
.
cacheDetail
():
if
klass
.
endswith
(
'MinPO'
):
self
.
assertEqual
(
count
,
CONNS
*
CACHE_SIZE
)
if
klass
.
endswith
(
'PersistentMapping'
):
# one root per connection
self
.
assertEqual
(
count
,
CONNS
)
for
details
in
self
.
db
.
cacheExtremeDetail
():
self
.
assertEqual
(
details
[
"klass"
],
"Persistence.PersistentMapping"
)
self
.
assertEqual
(
details
[
'state'
],
None
)
# one dict per object. keys:
if
details
[
'klass'
].
endswith
(
'PersistentMapping'
):
self
.
assertEqual
(
details
[
'state'
],
None
)
else
:
self
.
assert_
(
details
[
'klass'
].
endswith
(
'MinPO'
))
self
.
assertEqual
(
details
[
'state'
],
0
)
class
StubDataManager
:
def
setklassstate
(
self
,
object
):
...
...
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