[Zodb-checkins] CVS: ZODB3/ZEO/tests - test_cache.py:1.1.2.7

Jeremy Hylton cvs-admin at zope.org
Sat Nov 22 00:12:13 EST 2003


Update of /cvs-repository/ZODB3/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv28492/ZEO/tests

Modified Files:
      Tag: ZODB3-mvcc-2-branch
	test_cache.py 
Log Message:
Add test of new version behavior (return nothing when uncertain).
Fix load test that wasn't expecting 4-tuple return.


=== ZODB3/ZEO/tests/test_cache.py 1.1.2.6 => 1.1.2.7 ===
--- ZODB3/ZEO/tests/test_cache.py:1.1.2.6	Thu Nov 13 13:44:58 2003
+++ ZODB3/ZEO/tests/test_cache.py	Sat Nov 22 00:12:13 2003
@@ -50,8 +50,10 @@
         self.assertEqual(self.cache.load(n1, ""), None)
         self.assertEqual(self.cache.load(n1, "version"), None)
         self.cache.store(n1, "", n2, n3, None, data1)
-        self.assertEqual(self.cache.load(n1, ""), (data1, n2, n3))
-        self.assertEqual(self.cache.load(n1, "version"), (data1, n2, n3))
+        self.assertEqual(self.cache.load(n1, ""), (data1, n2, n3, ""))
+        # The cache doesn't know whether version exists, because it
+        # only has non-version data.
+        self.assertEqual(self.cache.load(n1, "version"), None)
         self.assertEqual(self.cache.modifiedInVersion(n1), None)
 
     def testInvalidate(self):
@@ -68,7 +70,8 @@
         data1v = "data for n1 in version"
         self.cache.store(n1, "version", n2, n3, None, data1v)
         self.assertEqual(self.cache.load(n1, ""), None)
-        self.assertEqual(self.cache.load(n1, "version"), (data1v, n2, n3))
+        self.assertEqual(self.cache.load(n1, "version"),
+                         (data1v, n2, n3, "version"))
         self.assertEqual(self.cache.load(n1, "random"), None)
         self.assertEqual(self.cache.modifiedInVersion(n1), "version")
         self.cache.invalidate(n1, "version", n4)




More information about the Zodb-checkins mailing list