[Zope3-checkins] CVS: ZODB4/src/zodb/storage/tests - basic.py:1.2.4.1

Barry Warsaw barry@wooz.org
Thu, 23 Jan 2003 14:02:01 -0500


Update of /cvs-repository/ZODB4/src/zodb/storage/tests
In directory cvs.zope.org:/tmp/cvs-serv29951

Modified Files:
      Tag: new-pickle-branch
	basic.py 
Log Message:
checkDatabaseVersion(), checkDatabaseVersionPersistent(): Add two
tests for the database serialization version, one that should pass for
every storage based on BaseStorage, and the other which will only pass
for persistent storages.

Note that the Berkeley storages will fail this second test in the
branch.  It will require the following 0-line patch when the
new-pickle-branch is merged back into the trunk:



=== ZODB4/src/zodb/storage/tests/basic.py 1.2 => 1.2.4.1 ===
--- ZODB4/src/zodb/storage/tests/basic.py:1.2	Wed Dec 25 09:12:20 2002
+++ ZODB4/src/zodb/storage/tests/basic.py	Thu Jan 23 14:01:58 2003
@@ -33,6 +33,18 @@
 
 
 class BasicStorage:
+    def checkDatabaseVersion(self):
+        version = (3, 2, 1, 'gamma', 5)
+        self._storage.setVersion(version)
+        self.assertEqual(version, self._storage.getVersion())
+
+    def checkDatabaseVersionPersistent(self):
+        version = (3, 2, 1, 'gamma', 5)
+        self._storage.setVersion(version)
+        self._storage.close()
+        self.open()
+        self.assertEqual(version, self._storage.getVersion())
+
     def checkBasics(self):
         t = Transaction()
         self._storage.tpc_begin(t)