Commit 3a1ba11c authored by Barry Warsaw's avatar Barry Warsaw

checkLRU(): I believe the tests were backwards: for objects still in

the cache, their changes are flushed but they're not ghostified, so
their _p_changed == 0.  For objects not in the cache, they are
ghostified and so their _p_changed == None.  The tests had the check
values reversed.
parent ea26760f
......@@ -142,9 +142,11 @@ class LRUCacheTests(CacheTestBase):
self.assertEqual(x._p_changed, None) # the root is ghosted
for i in range(len(l)):
if i < CACHE_SIZE:
self.assertEqual(l[i]._p_changed, None)
else:
# Changes are flushed but objects not ghostified
self.assertEqual(l[i]._p_changed, 0)
else:
# Objects are ghostified and evicted from the cache
self.assertEqual(l[i]._p_changed, None)
def checkSize(self):
self.assertEqual(self.db.cacheSize(), 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment