[Zope3-checkins] CVS: Zope3/src/zodb/storage/tests - undo.py:1.16

Barry Warsaw barry@zope.com
Fri, 16 May 2003 17:36:58 -0400


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

Modified Files:
	undo.py 
Log Message:
Use a more modern spelling of "does this storage support undo?"


=== Zope3/src/zodb/storage/tests/undo.py 1.15 => 1.16 ===
--- Zope3/src/zodb/storage/tests/undo.py:1.15	Fri Apr 25 15:28:46 2003
+++ Zope3/src/zodb/storage/tests/undo.py	Fri May 16 17:36:57 2003
@@ -27,6 +27,7 @@
 from zodb.storage.tests.minpo import MinPO
 from zodb.storage.tests.base import zodb_pickle, zodb_unpickle, snooze
 from zodb.storage.tests.base import handle_serials
+from zodb.storage.interfaces import IUndoStorage
 
 from persistence import Persistent
 from transaction import get_transaction
@@ -84,9 +85,9 @@
 
     def _iterate(self):
         """Iterate over the storage in its final state."""
-        # This is testing that the iterator() code works correctly.
-        # The hasattr() guards against ZEO, which doesn't support iterator.
-        if not hasattr(self._storage, "iterator"):
+        # This is testing that the iterator() code works correctly, but not
+        # all storages support iteration.
+        if not IUndoStorage.isImplementedBy(self._storage):
             return
         iter = self._storage.iterator()
         for txn in iter:
@@ -658,7 +659,7 @@
 
     def testTransactionalUndoIterator(self):
         # check that data_txn set in iterator makes sense
-        if not hasattr(self._storage, "iterator"):
+        if not IUndoStorage.isImplementedBy(self._storage):
             return
 
         s = self._storage