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

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


Log message for revision 74830:
  Changed to work with storages that don't support versions.
  

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

-=-
Modified: ZODB/trunk/src/ZODB/tests/Synchronization.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/Synchronization.py	2007-04-26 23:19:25 UTC (rev 74829)
+++ ZODB/trunk/src/ZODB/tests/Synchronization.py	2007-04-26 23:19:28 UTC (rev 74830)
@@ -84,21 +84,33 @@
         self.assertRaises(StorageTransactionError, callable, *args)
         self._storage.tpc_abort(t)
 
+    def __supportsVersions(self):
+        storage = self._storage
+        try:
+            supportsVersions = storage.supportsVersions
+        except AttributeError:
+            return False
+        return supportsVersions()
+
     def checkAbortVersionNotCommitting(self):
-        self.verifyNotCommitting(self._storage.abortVersion,
-                                 VERSION, Transaction())
+        if self.__supportsVersions():
+            self.verifyNotCommitting(self._storage.abortVersion,
+                                     VERSION, Transaction())
 
     def checkAbortVersionWrongTrans(self):
-        self.verifyWrongTrans(self._storage.abortVersion,
-                              VERSION, Transaction())
+        if self.__supportsVersions():
+            self.verifyWrongTrans(self._storage.abortVersion,
+                                  VERSION, Transaction())
 
     def checkCommitVersionNotCommitting(self):
-        self.verifyNotCommitting(self._storage.commitVersion,
-                                 VERSION, "", Transaction())
+        if self.__supportsVersions():
+            self.verifyNotCommitting(self._storage.commitVersion,
+                                     VERSION, "", Transaction())
 
     def checkCommitVersionWrongTrans(self):
-        self.verifyWrongTrans(self._storage.commitVersion,
-                              VERSION, "", Transaction())
+        if self.__supportsVersions():
+            self.verifyWrongTrans(self._storage.commitVersion,
+                                  VERSION, "", Transaction())
 
 
     def checkStoreNotCommitting(self):



More information about the Zodb-checkins mailing list