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

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

parent 7ceb5bd6
......@@ -84,19 +84,31 @@ class SynchronizedStorage:
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):
if self.__supportsVersions():
self.verifyNotCommitting(self._storage.abortVersion,
VERSION, Transaction())
def checkAbortVersionWrongTrans(self):
if self.__supportsVersions():
self.verifyWrongTrans(self._storage.abortVersion,
VERSION, Transaction())
def checkCommitVersionNotCommitting(self):
if self.__supportsVersions():
self.verifyNotCommitting(self._storage.commitVersion,
VERSION, "", Transaction())
def checkCommitVersionWrongTrans(self):
if self.__supportsVersions():
self.verifyWrongTrans(self._storage.commitVersion,
VERSION, "", Transaction())
......
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