[Zope3-checkins] CVS: Zope3/src/zodb/storage/tests - version.py:1.3.4.1

Jeremy Hylton jeremy@zope.com
Tue, 11 Mar 2003 15:18:30 -0500


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

Modified Files:
      Tag: opaque-pickles-branch
	version.py 
Log Message:
Add a minimal pack test involving versions.


=== Zope3/src/zodb/storage/tests/version.py 1.3 => 1.3.4.1 ===
--- Zope3/src/zodb/storage/tests/version.py:1.3	Wed Feb  5 18:28:27 2003
+++ Zope3/src/zodb/storage/tests/version.py	Tue Mar 11 15:18:29 2003
@@ -16,12 +16,17 @@
 Any storage that supports versions should be able to pass all these tests.
 """
 
+import time
+
 from zodb import interfaces
+from zodb.db import DB
 from zodb.ztransaction import Transaction
 from zodb.storage.tests.minpo import MinPO
 from zodb.storage.tests.base import zodb_unpickle
 from zodb.storage.interfaces import IUndoStorage, IVersionStorage
 
+from transaction import get_transaction
+
 
 class VersionStorage:
 
@@ -332,3 +337,15 @@
                           self._storage.load, oid, '')
         self.assertRaises(KeyError,
                           self._storage.load, oid, 'two')
+
+    def checkPackVersions(self):
+        db = DB(self._storage)
+        cn = db.open(version="testversion")
+        root = cn.root()
+
+        obj = root["obj"] = MinPO("obj")
+        txn = get_transaction()
+        txn.note("create obj in version")
+        txn.commit()
+
+        self._storage.pack(time.time())