[Zodb-checkins] CVS: Zope3/src/zodb/storage/tests - undo.py:1.5.4.2
Jeremy Hylton
jeremy@zope.com
Mon, 10 Mar 2003 17:45:03 -0500
Update of /cvs-repository/Zope3/src/zodb/storage/tests
In directory cvs.zope.org:/tmp/cvs-serv18942/storage/tests
Modified Files:
Tag: opaque-pickles-branch
undo.py
Log Message:
Use the new _linked_newobj() helper method.
This helper changes the initial number of txns from 3 to 5.
=== Zope3/src/zodb/storage/tests/undo.py 1.5.4.1 => 1.5.4.2 ===
--- Zope3/src/zodb/storage/tests/undo.py:1.5.4.1 Mon Feb 10 18:21:08 2003
+++ Zope3/src/zodb/storage/tests/undo.py Mon Mar 10 17:45:00 2003
@@ -451,8 +451,10 @@
def checkTransactionalUndoAfterPack(self):
eq = self.assertEqual
# Add a few object revisions
- oid = self._storage.newObjectId()
- revid1 = self._dostore(oid, data=MinPO(51))
+ self._initroot()
+ obj, root, revid0 = self._linked_newobj()
+ oid = obj._p_oid
+ revid1 = self._dostore(oid, data=MinPO(51), revid=obj._p_serial)
# For the pack(), we need a timestamp greater than revid1's timestamp.
# The semantics of pack()'s `t' argument is that all non-current
# revisions with an earlier timestamp will be packed away. If they
@@ -465,12 +467,14 @@
revid3 = self._dostore(oid, revid=revid2, data=MinPO(53))
# Now get the undo log
info = self._storage.undoInfo()
- eq(len(info), 3)
+ eq(len(info), 5)
tid = info[0]['id']
+
# Now pack just the initial revision of the object. We need the
# second revision otherwise we won't be able to undo the third
# revision!
self._storage.pack(packtime)
+
# Make some basic assertions about the undo information now
info2 = self._storage.undoInfo()
eq(len(info2), 2)