[Zodb-checkins] CVS: StandaloneZODB/ZODB/tests - VersionStorage.py:1.11

Jeremy Hylton jeremy@zope.com
Fri, 26 Oct 2001 16:17:25 -0400


Update of /cvs-repository/StandaloneZODB/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv23396

Modified Files:
	VersionStorage.py 
Log Message:
Tests for transactional undo support need to be more cautious:

If a storage doesn't support T.U. and is old enough, you need to first
check if it has a supportsTransactionalUndo attribute.


=== StandaloneZODB/ZODB/tests/VersionStorage.py 1.10 => 1.11 ===
 
         # And try to abort the empty version
-        if self._storage.supportsTransactionalUndo():
+        if (hasattr(self._storage, 'supportsTransactionalUndo')
+            and self._storage.supportsTransactionalUndo()):
             # XXX FileStorage used to be broken on this one
             self.assertRaises(POSException.VersionError,
                               self._storage.abortVersion,
@@ -185,7 +186,8 @@
         eq(zodb_unpickle(data), MinPO(51))
 
     def checkCommitVersionErrors(self):
-        if not self._storage.supportsTransactionalUndo():
+        if not (hasattr(self._storage, 'supportsTransactionalUndo')
+            and self._storage.supportsTransactionalUndo()):
             # XXX FileStorage used to be broken on this one
             return
         eq = self.assertEqual