[Zodb-checkins] SVN: ZODB/trunk/src/ZODB/tests/MTStorage.py Changed to work with storages that don't support either versions or undo.

Jim Fulton jim at zope.com
Thu Apr 26 19:20:00 EDT 2007


Log message for revision 74835:
  Changed to work with storages that don't support either versions or undo.
  

Changed:
  U   ZODB/trunk/src/ZODB/tests/MTStorage.py

-=-
Modified: ZODB/trunk/src/ZODB/tests/MTStorage.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/MTStorage.py	2007-04-26 23:19:56 UTC (rev 74834)
+++ ZODB/trunk/src/ZODB/tests/MTStorage.py	2007-04-26 23:20:00 UTC (rev 74835)
@@ -162,9 +162,25 @@
     def runtest(self):
         # pick some other storage ops to execute, depending in part
         # on the features provided by the storage.
-        names = ["do_load", "do_modifiedInVersion"]
-        if self.storage.supportsUndo():
-            names += ["do_loadSerial", "do_undoLog", "do_iterator"]
+        names = ["do_load"]
+
+        storage = self.storage
+        try:
+            supportsVersions = storage.supportsVersions
+        except AttributeError:
+            pass
+        else:
+            if supportsVersions():
+                names.append("do_modifiedInVersion")
+
+        try:
+            supportsUndo = storage.supportsUndo
+        except AttributeError:
+            pass
+        else:
+            if supportsUndo():
+                names += ["do_loadSerial", "do_undoLog", "do_iterator"]
+
         ops = [getattr(self, meth) for meth in names]
         assert ops, "Didn't find an storage ops in %s" % self.storage
         # do a store to guarantee there's at least one oid in self.oids



More information about the Zodb-checkins mailing list