Commit 32425b5a authored by Jeremy Hylton's avatar Jeremy Hylton

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
parent 21067f66
...@@ -144,6 +144,8 @@ class BasicStorage: ...@@ -144,6 +144,8 @@ class BasicStorage:
noteq(revid3, revid4) noteq(revid3, revid4)
def checkGetSerial(self): def checkGetSerial(self):
if not hasattr(self._storage, 'getSerial'):
return
eq = self.assertEqual eq = self.assertEqual
p41, p42 = map(MinPO, (41, 42)) p41, p42 = map(MinPO, (41, 42))
oid = self._storage.new_oid() oid = self._storage.new_oid()
......
...@@ -33,8 +33,9 @@ class VersionStorage: ...@@ -33,8 +33,9 @@ class VersionStorage:
eq(zodb_unpickle(data), MinPO(12)) eq(zodb_unpickle(data), MinPO(12))
data, vrevid = self._storage.load(oid, version) data, vrevid = self._storage.load(oid, version)
eq(zodb_unpickle(data), MinPO(15)) eq(zodb_unpickle(data), MinPO(15))
s = self._storage.getSerial(oid) if hasattr(self._storage, 'getSerial'):
eq(s, max(revid, vrevid)) s = self._storage.getSerial(oid)
eq(s, max(revid, vrevid))
def checkVersionedLoadErrors(self): def checkVersionedLoadErrors(self):
oid = self._storage.new_oid() oid = self._storage.new_oid()
...@@ -168,9 +169,11 @@ class VersionStorage: ...@@ -168,9 +169,11 @@ class VersionStorage:
#JF# 'bogus', self._transaction) #JF# 'bogus', self._transaction)
# And try to abort the empty version # And try to abort the empty version
self.assertRaises(POSException.VersionError, if self._storage.supportsTransactionalUndo():
self._storage.abortVersion, # XXX FileStorage used to be broken on this one
'', self._transaction) self.assertRaises(POSException.VersionError,
self._storage.abortVersion,
'', self._transaction)
# But now we really try to abort the version # But now we really try to abort the version
oids = self._storage.abortVersion(version, self._transaction) oids = self._storage.abortVersion(version, self._transaction)
...@@ -182,6 +185,9 @@ class VersionStorage: ...@@ -182,6 +185,9 @@ class VersionStorage:
eq(zodb_unpickle(data), MinPO(51)) eq(zodb_unpickle(data), MinPO(51))
def checkCommitVersionErrors(self): def checkCommitVersionErrors(self):
if not self._storage.supportsTransactionalUndo():
# XXX FileStorage used to be broken on this one
return
eq = self.assertEqual eq = self.assertEqual
oid1, version1 = self._setup_version('one') oid1, version1 = self._setup_version('one')
data, revid1 = self._storage.load(oid1, version1) data, revid1 = self._storage.load(oid1, version1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment