[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Caching/RAMCache/tests - test_RAMCache.py:1.8

Marius Gedminas mgedmin@codeworks.lt
Thu, 12 Dec 2002 10:28:46 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Caching/RAMCache/tests
In directory cvs.zope.org:/tmp/cvs-serv24277/lib/python/Zope/App/Caching/RAMCache/tests

Modified Files:
	test_RAMCache.py 
Log Message:
Caching service now uses the new configuration infrastructure
Added invalidateAll to Zope.App.Caching.ICache



=== Zope3/lib/python/Zope/App/Caching/RAMCache/tests/test_RAMCache.py 1.7 => 1.8 ===
--- Zope3/lib/python/Zope/App/Caching/RAMCache/tests/test_RAMCache.py:1.7	Fri Dec  6 04:54:14 2002
+++ Zope3/lib/python/Zope/App/Caching/RAMCache/tests/test_RAMCache.py	Thu Dec 12 10:28:15 2002
@@ -377,6 +377,26 @@
                          {object: {key: [value, ts, 0], key2: [value, ts, 0]}},
                          "failed to invalidate queued")
 
+    def test_invalidateAll(self):
+        from Zope.App.Caching.RAMCache.RAMCache import Storage
+        s = Storage()
+        object = 'object'
+        object2 = 'object2'
+        key = ('view', (), ('answer', 41))
+        key2 = ('view2', (), ('answer', 42))
+        value = 'yes'
+        ts = time()
+        s._data = {object:  {key: [value, ts, 0],
+                             key2: [value, ts, 0]},
+                   object2: {key: [value, ts, 0]}}
+        s._invalidate_queue = [(object, None)]
+        s._misses = {object: 10, object2: 100}
+        s.invalidateAll()
+        self.assertEqual(s._data, {}, "not invalidated")
+        self.assertEqual(s._misses, {}, "miss counters not reset")
+        self.assertEqual(s._invalidate_queue, [], "invalidate queue not empty")
+
+
     def test_getKeys(self):
         from Zope.App.Caching.RAMCache.RAMCache import Storage
         s = Storage()