[Zope-Checkins] CVS: ZODB3/ZODB/tests - PackableStorage.py:1.28

Jeremy Hylton jeremy at zope.com
Fri Jan 16 11:46:58 EST 2004


Update of /cvs-repository/ZODB3/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv31023

Modified Files:
	PackableStorage.py 
Log Message:
Force test to fail if FileStorage doesn't raise StorageError
for a redundant pack.


=== ZODB3/ZODB/tests/PackableStorage.py 1.27 => 1.28 ===
--- ZODB3/ZODB/tests/PackableStorage.py:1.27	Fri Jan 16 10:46:35 2004
+++ ZODB3/ZODB/tests/PackableStorage.py	Fri Jan 16 11:46:57 2004
@@ -34,6 +34,7 @@
 from ZODB.tests.MinPO import MinPO
 from ZODB.tests.StorageTestBase import snooze
 from ZODB.POSException import ConflictError, StorageError
+from ZODB.FileStorage import FileStorage
 
 from ZODB.tests.MTStorage import TestThread
 
@@ -473,13 +474,12 @@
         packt2 = time.time()
 
         db.pack(packt2)
-        # BDBStorage allows the second pack, but doesn't lose data.
-        try:
+        if isinstance(self._storage, FileStorage):
+            # If FileStorage performed a redundant pack, it would
+            # remove the lost_oid.
+            self.assertRaises(StorageError, db.pack, packt1)
+        else:
             db.pack(packt1)
-        except StorageError:
-            pass
-        # This object would be removed by the second pack, even though
-        # it is reachable.
         self._storage.load(lost_oid, "")
 
     def checkPackUndoLog(self):




More information about the Zope-Checkins mailing list