Commit 8b6b21aa authored by Jim Fulton's avatar Jim Fulton

Changed to work with storages that don't support versions.

parent 7ceb5bd6
...@@ -84,21 +84,33 @@ class SynchronizedStorage: ...@@ -84,21 +84,33 @@ class SynchronizedStorage:
self.assertRaises(StorageTransactionError, callable, *args) self.assertRaises(StorageTransactionError, callable, *args)
self._storage.tpc_abort(t) self._storage.tpc_abort(t)
def __supportsVersions(self):
storage = self._storage
try:
supportsVersions = storage.supportsVersions
except AttributeError:
return False
return supportsVersions()
def checkAbortVersionNotCommitting(self): def checkAbortVersionNotCommitting(self):
self.verifyNotCommitting(self._storage.abortVersion, if self.__supportsVersions():
VERSION, Transaction()) self.verifyNotCommitting(self._storage.abortVersion,
VERSION, Transaction())
def checkAbortVersionWrongTrans(self): def checkAbortVersionWrongTrans(self):
self.verifyWrongTrans(self._storage.abortVersion, if self.__supportsVersions():
VERSION, Transaction()) self.verifyWrongTrans(self._storage.abortVersion,
VERSION, Transaction())
def checkCommitVersionNotCommitting(self): def checkCommitVersionNotCommitting(self):
self.verifyNotCommitting(self._storage.commitVersion, if self.__supportsVersions():
VERSION, "", Transaction()) self.verifyNotCommitting(self._storage.commitVersion,
VERSION, "", Transaction())
def checkCommitVersionWrongTrans(self): def checkCommitVersionWrongTrans(self):
self.verifyWrongTrans(self._storage.commitVersion, if self.__supportsVersions():
VERSION, "", Transaction()) self.verifyWrongTrans(self._storage.commitVersion,
VERSION, "", Transaction())
def checkStoreNotCommitting(self): def checkStoreNotCommitting(self):
......
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