[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Caching/tests - testICache.py:1.4
Marius Gedminas
mgedmin@codeworks.lt
Thu, 12 Dec 2002 10:28:46 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Caching/tests
In directory cvs.zope.org:/tmp/cvs-serv24277/lib/python/Zope/App/Caching/tests
Modified Files:
testICache.py
Log Message:
Caching service now uses the new configuration infrastructure
Added invalidateAll to Zope.App.Caching.ICache
=== Zope3/lib/python/Zope/App/Caching/tests/testICache.py 1.3 => 1.4 ===
--- Zope3/lib/python/Zope/App/Caching/tests/testICache.py:1.3 Mon Nov 25 08:48:06 2002
+++ Zope3/lib/python/Zope/App/Caching/tests/testICache.py Thu Dec 12 10:28:16 2002
@@ -51,6 +51,23 @@
self.failIf(cache.query(ob, {'id': 33}, default=marker) is not marker,
"should not return cached result after invalidate")
+ def testInvalidateAll(self):
+ cache = self._Test__new()
+ ob1 = object()
+ ob2 = object()
+ cache.set("data1", ob1)
+ cache.set("data2", ob2, key={'foo': 1})
+ cache.set("data3", ob2, key={'foo': 2})
+ cache.invalidateAll()
+ marker = []
+ self.failIf(cache.query(ob1, default=marker) is not marker,
+ "should not return cached result after invalidateAll")
+ self.failIf(cache.query(ob2, {'foo': 1}, default=marker) is not marker,
+ "should not return cached result after invalidateAll")
+ self.failIf(cache.query(ob2, {'foo': 2}, default=marker) is not marker,
+ "should not return cached result after invalidateAll")
+
+
def test_suite():
return TestSuite((
))