[Zodb-checkins] CVS: StandaloneZODB/ZEO/tests - Cache.py:1.3.2.1 testZEO.py:1.9.2.6

Jeremy Hylton jeremy@zope.com
Fri, 26 Oct 2001 15:37:04 -0400


Update of /cvs-repository/StandaloneZODB/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv14802

Modified Files:
      Tag: zeo-1_0-branch
	Cache.py testZEO.py 
Log Message:
Update tests so that ZEO tests pass on Zope 2.3.

There are a few problems with Zope 2.3 that prevented the tests from
succeeding.  Since the 1.0 release must support Zope 2.3, we'll need
to hack the various tests to work around them.

    Assuming releases after 1.0 don't need to work with 2.3: After the
    1.0 final release, I'll tag both ZEO and ZODB trees and then undo
    all these silly changes.

Problems:

    - no support for transactional undo or getSerial()
    - FileStorage commitVersion() and abortVersion() didn't check for
      bogus arguments


=== StandaloneZODB/ZEO/tests/Cache.py 1.3 => 1.3.2.1 ===
 
         info = self._storage.undoInfo()
+        if not info:
+            # XXX perhaps we have an old storage implementation that
+            # does do the negative nonsense
+            info = self._storage.undoInfo(0, 20)
         tid = info[0]['id']
+
+        # We may need to bail at this point if the storage doesn't
+        # support transactional undo
+        if not self._storage.supportsTransactionalUndo():
+            return
+
         # Now start an undo transaction
         self._transaction.note('undo1')
         self._storage.tpc_begin(self._transaction)


=== StandaloneZODB/ZEO/tests/testZEO.py 1.9.2.5 => 1.9.2.6 ===
                 d[oid] = serial
         return d
+
+# Some of the ZEO tests depend on the version of FileStorage available
+# for the tests.  If we run these tests using Zope 2.3, FileStorage
+# doesn't support TransactionalUndo.
+
+if hasattr(FileStorage, 'supportsTransactionalUndo'):
+    # XXX Assume that a FileStorage that supports transactional undo
+    # also supports conflict resolution.
+    class VersionDependentTests(
+        TransactionalUndoStorage.TransactionalUndoStorage,
+        TransactionalUndoVersionStorage.TransactionalUndoVersionStorage,
+        ConflictResolution.ConflictResolvingStorage,
+        ConflictResolution.ConflictResolvingTransUndoStorage):
+        pass
+else:
+    class VersionDependentTests:
+        pass
         
 class GenericTests(ZEOTestBase,
+                   VersionDependentTests,
                    Cache.StorageWithCache,
                    Cache.TransUndoStorageWithCache,
                    BasicStorage.BasicStorage,
                    VersionStorage.VersionStorage,
                    PackableStorage.PackableStorage,
                    Synchronization.SynchronizedStorage,
-                   ConflictResolution.ConflictResolvingStorage,
-                   ConflictResolution.ConflictResolvingTransUndoStorage,
-                   TransactionalUndoStorage.TransactionalUndoStorage,
-      TransactionalUndoVersionStorage.TransactionalUndoVersionStorage,
                    ):
     """An abstract base class for ZEO tests