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

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


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

Modified Files:
      Tag: opaque-pickles-branch
	version.py 
Log Message:
Flesh out the pack + version test.

It exposes an error in _commitVersion() that isn't fixed yet.


=== Zope3/src/zodb/storage/tests/version.py 1.3.4.1 => 1.3.4.2 ===
--- Zope3/src/zodb/storage/tests/version.py:1.3.4.1	Tue Mar 11 15:18:29 2003
+++ Zope3/src/zodb/storage/tests/version.py	Tue Mar 11 18:37:57 2003
@@ -344,8 +344,38 @@
         root = cn.root()
 
         obj = root["obj"] = MinPO("obj")
+        root["obj2"] = MinPO("obj2")
         txn = get_transaction()
-        txn.note("create obj in version")
+        txn.note("create 2 objs in version")
+        txn.commit()
+
+        obj.value = "77"
+        txn = get_transaction()
+        txn.note("modify obj in version")
+        txn.commit()
+
+        # undo the modification to generate a mix of backpointers
+        # and versions for pack to chase
+        info = db.undoInfo()
+        db.undo(info[0]["id"])
+        txn = get_transaction()
+        txn.note("undo modification")
         txn.commit()
 
         self._storage.pack(time.time())
+
+        db.commitVersion("testversion")
+        txn = get_transaction()
+        txn.note("commit version")
+        txn.commit()
+        
+        cn = db.open()
+        root = cn.root()
+        root["obj"] = "no version"
+        
+        txn = get_transaction()
+        txn.note("modify obj")
+        txn.commit()
+        
+        self._storage.pack(time.time())
+