[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Caching/tests - testICache.py:1.3

Albertas Agejevas alga@codeworks.lt
Mon, 25 Nov 2002 08:48:37 -0500


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

Modified Files:
	testICache.py 
Log Message:
Cleaned up the RAMCache.

Removed all the references to Request from RAMCache, removed 'view' parameters
from the ICache interface.


=== Zope3/lib/python/Zope/App/Caching/tests/testICache.py 1.2 => 1.3 ===
--- Zope3/lib/python/Zope/App/Caching/tests/testICache.py:1.2	Thu Oct 31 11:01:40 2002
+++ Zope3/lib/python/Zope/App/Caching/tests/testICache.py	Mon Nov 25 08:48:06 2002
@@ -36,31 +36,20 @@
         ob = "obj"
         data = "data"
         marker = []
-        self.failIf(cache.query(ob, default=marker) is not marker,
+        self.failIf(cache.query(ob, None, default=marker) is not marker,
                     "empty cache should not contain anything")
 
-        cache.set(data, ob, view_name="view1")
-        self.assertEquals(cache.query(ob, "view1"), data,
+        cache.set(data, ob, key={'id': 35})
+        self.assertEquals(cache.query(ob, {'id': 35}), data,
                     "should return cached result")
-        self.failIf(cache.query(ob, "view2", default=marker) is not marker,
-                    "should not return cached result for a different view")
+        self.failIf(cache.query(ob, {'id': 33}, default=marker) is not marker,
+                    "should not return cached result for a different key")
 
-        cache.invalidate(ob, "view2")
-        self.assertEquals(cache.query(ob, "view1"), data,
-                    "should return cached result")
-        self.failIf(cache.query(ob, "view2", default=marker) is not marker,
-                    "should not return cached result for a different view")
-
-        cache.invalidate(ob, "view1")
-        self.failIf(cache.query(ob, "view1", default=marker) is not marker,
+        cache.invalidate(ob, {"id": 33})
+        self.assertEquals(cache.query(ob, {'id': 35}), data,
+                          "should return cached result")
+        self.failIf(cache.query(ob, {'id': 33}, default=marker) is not marker,
                     "should not return cached result after invalidate")
-
-# TODO: test all cases of invalidate (all, only view, view and keywords)
-#       test set/query with keywords
-#       test uses of mtime_func
-
-# So far there are no classes implementing ICache, so running the tests will
-# have to be deferred
 
 def test_suite():
     return TestSuite((