[Zodb-checkins] CVS: ZODB4/src/zodb/storage/tests - recovery.py:1.4.4.4

Barry Warsaw barry@wooz.org
Wed, 12 Mar 2003 12:28:50 -0500


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

Modified Files:
      Tag: opaque-pickles-branch
	recovery.py 
Log Message:
checkRestoreAcrossPack(): a slightly stronger assertion, since we know
the first record will have data and refs, but the second one will be
None, None.


=== ZODB4/src/zodb/storage/tests/recovery.py 1.4.4.3 => 1.4.4.4 ===
--- ZODB4/src/zodb/storage/tests/recovery.py:1.4.4.3	Wed Mar 12 12:17:22 2003
+++ ZODB4/src/zodb/storage/tests/recovery.py	Wed Mar 12 12:28:46 2003
@@ -137,6 +137,7 @@
         self.compare(self._storage, self._dst)
 
     def checkRestoreAcrossPack(self):
+        eq = self.assertEqual
         db = DB(self._storage)
         c = db.open()
         r = c.root()
@@ -155,16 +156,19 @@
         iter = self._storage.iterator()
         final = list(iter)[-1]
         self._dst.tpcBegin(final, final.tid, final.status)
+        datarefs = []
         for r in final:
-            if r.data is None:
-                self.assert_(r.refs is None)
-            else:
-                self.assertEqual(findrefs(r.data), list(r.refs))
+            datarefs.append((r.data, r.refs))
             self._dst.restore(r.oid, r.serial, r.data, r.version, r.data_txn,
                               r.refs, final)
         self._dst.tpcVote(final)
         self._dst.tpcFinish(final)
         iter.close()
+        data, refs = datarefs[0]
+        eq(findrefs(data), refs)
+        data, refs = datarefs[1]
+        eq(data, None)
+        eq(refs, None)
 
     def checkPackWithGCOnDestinationAfterRestore(self):
         raises = self.assertRaises