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:
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):
self.verifyNotCommitting(self._storage.abortVersion,
VERSION, Transaction())
if self.__supportsVersions():
self.verifyNotCommitting(self._storage.abortVersion,
VERSION, Transaction())
def checkAbortVersionWrongTrans(self):
self.verifyWrongTrans(self._storage.abortVersion,
VERSION, Transaction())
if self.__supportsVersions():
self.verifyWrongTrans(self._storage.abortVersion,
VERSION, Transaction())
def checkCommitVersionNotCommitting(self):
self.verifyNotCommitting(self._storage.commitVersion,
VERSION, "", Transaction())
if self.__supportsVersions():
self.verifyNotCommitting(self._storage.commitVersion,
VERSION, "", Transaction())
def checkCommitVersionWrongTrans(self):
self.verifyWrongTrans(self._storage.commitVersion,
VERSION, "", Transaction())
if self.__supportsVersions():
self.verifyWrongTrans(self._storage.commitVersion,
VERSION, "", Transaction())
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