[Zope-Checkins] CVS: StandaloneZODB/ZODB/tests - testCache.py:1.4

Barry Warsaw barry@wooz.org
Mon, 29 Apr 2002 13:02:51 -0400


Update of /cvs-repository/StandaloneZODB/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv29998

Modified Files:
	testCache.py 
Log Message:
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.


=== StandaloneZODB/ZODB/tests/testCache.py 1.3 => 1.4 ===
         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)