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

Steve Alexander steve@cat-box.net
Wed, 13 Nov 2002 10:16:41 -0500


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

Modified Files:
	test_RAMCache.py 
Log Message:
Hopefully this fixes the recent bugs in the automatic test-runs on
windows.
See the new test code for why.

SteveA + Marius


=== Zope3/lib/python/Zope/App/Caching/RAMCache/tests/test_RAMCache.py 1.1 => 1.2 ===
--- Zope3/lib/python/Zope/App/Caching/RAMCache/tests/test_RAMCache.py:1.1	Thu Oct 31 11:01:40 2002
+++ Zope3/lib/python/Zope/App/Caching/RAMCache/tests/test_RAMCache.py	Wed Nov 13 10:16:41 2002
@@ -118,6 +118,15 @@
         self.assertEqual(storage1.cleanupInterval, 42,
                          "cleanupInterval not set")
 
+        # Simulate persisting and restoring the RamCache which removes
+        # all _v_ attributes.
+        for k in c.__dict__.keys():
+            if k.startswith('_v_'):
+                del c.__dict__[k]
+        storage2 = c._getStorage()
+        self.assertEqual(storage1, storage2,
+                         "_getStorage returns different storages")
+
     def test_buildKey(self): 
         from Zope.App.Caching.RAMCache.RAMCache import RAMCache