[Zodb-checkins] CVS: Zope3/lib/python/Persistence/tests - testCache.py:1.1.2.2

Jim Fulton jim@zope.com
Sun, 25 Nov 2001 19:19:51 -0500


Update of /cvs-repository/Zope3/lib/python/Persistence/tests
In directory cvs.zope.org:/tmp/cvs-serv14440/tests

Modified Files:
      Tag: Zope-3x-branch
	testCache.py 
Log Message:
Factored multiple and single cache invalidation

=== Zope3/lib/python/Persistence/tests/testCache.py 1.1.2.1 => 1.1.2.2 ===
                          )
         p=dm.cache[1]
-        dm.cache.invalidate((1,))
+        dm.cache.invalidate(1)
         self.assertEqual(dm.cache.statistics(),
                          {'ghosts': 1, 'active': 0},
                          )
         self.assertEqual(p._p_changed, None)
+
+        p.a=1
+        p._p_changed=0
+        self.assertEqual(dm.cache.statistics(),
+                         {'ghosts': 0, 'active': 1},
+                         )
+        dm.cache.invalidateMany([1])
+        self.assertEqual(dm.cache.statistics(),
+                         {'ghosts': 1, 'active': 0},
+                         )
+        self.assertEqual(p._p_changed, None)
+
+        p.a=1
+        p._p_changed=0
+        self.assertEqual(dm.cache.statistics(),
+                         {'ghosts': 0, 'active': 1},
+                         )
+        dm.cache.invalidateMany(None)
+        self.assertEqual(dm.cache.statistics(),
+                         {'ghosts': 1, 'active': 0},
+                         )
+        self.assertEqual(p._p_changed, None)
+
+
+
         p.a=1
         self.assertEqual(dm.cache.statistics(),
                          {'ghosts': 0, 'active': 1},