[Zope3-checkins] CVS: ZODB4/ZODB/tests - RecoveryStorage.py:1.2

Jeremy Hylton jeremy@zope.com
Thu, 5 Dec 2002 19:02:13 -0500


Update of /cvs-repository/ZODB4/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv6564

Modified Files:
	RecoveryStorage.py 
Log Message:
Sync with ZODB3 version.




=== ZODB4/ZODB/tests/RecoveryStorage.py 1.1 => 1.2 ===
--- ZODB4/ZODB/tests/RecoveryStorage.py:1.1	Mon Nov 25 14:54:50 2002
+++ ZODB4/ZODB/tests/RecoveryStorage.py	Thu Dec  5 19:02:13 2002
@@ -1,4 +1,20 @@
-"""More recovery and iterator tests."""
+##############################################################################
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+# 
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+# 
+##############################################################################
+"""More recovery and iterator tests.
+
+$Id$
+"""
 
 from ZODB.ZTransaction import Transaction
 from ZODB.tests.IteratorStorage import IteratorDeepCompare
@@ -70,7 +86,13 @@
 
         # now copy the records to a new storage
         self._dst.copyTransactionsFrom(self._storage)
-        
+        self.compare(self._storage, self._dst)
+
+        # The last two transactions were applied directly rather than
+        # copied.  So we can't use compare() to verify that they new
+        # transactions are applied correctly.  (The new transactions
+        # will have different timestamps for each storage.)
+
         self._abortVersion(version)
         self.assert_(self._storage.versionEmpty(version))
         self._undo(self._storage.undoInfo()[0]['id'], oid)
@@ -96,10 +118,13 @@
         data, revid = self._storage.load(oid, '')
         self.assertEqual(zodb_unpickle(data), MinPO(91))
 
+        # swap them back
+        self._storage = tmp
+
         # Now remove _dst and copy all the transactions a second time.
         # This time we will be able to confirm via compare().
-        self._storage = tmp
         self._dst.close()
-        self._dst = self.new_dest()
+        StorageTestBase.removefs("Dest.fs")
+        self._dst = ZODB.FileStorage.FileStorage('Dest.fs')
         self._dst.copyTransactionsFrom(self._storage)
         self.compare(self._storage, self._dst)