[Zope-Checkins] CVS: StandaloneZODB/ZODB/tests - testFileStorage.py:1.14.4.2

Jeremy Hylton jeremy@zope.com
Thu, 24 Jan 2002 18:13:53 -0500


Update of /cvs-repository/StandaloneZODB/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv5940

Modified Files:
      Tag: Recovery
	testFileStorage.py 
Log Message:
Add another test.

This *should* fail with the current FileStorage recover() impl, but it
doesn't for some reason.  The dest's last transaction does not return
a data record with None as the data attribute.


=== StandaloneZODB/ZODB/tests/testFileStorage.py 1.14.4.1 => 1.14.4.2 ===
         self.compare(self._storage, self._dst)
 
+    def checkRecoverAbortVersion(self):
+        oid = self._storage.new_oid()
+        revid = self._dostore(oid, data=21, version="one")
+        revid = self._dostore(oid, revid=revid, data=23, version='one')
+        revid = self._dostore(oid, revid=revid, data=34, version='one')
+        # Now abort the version and the creation
+        t = Transaction()
+        self._storage.tpc_begin(t)
+        self._storage.abortVersion('one', t)
+        self._storage.tpc_vote(t)
+        self._storage.tpc_finish(t)
+        self._dst.copyTransactionsFrom(self._storage)
+        self.compare(self._storage, self._dst)
+
 def test_suite():
     suite = unittest.makeSuite(FileStorageTests, 'check')
     suite2 = unittest.makeSuite(Corruption.FileStorageCorruptTests, 'check')