Commit a6979eca authored by Toby Dickenson's avatar Toby Dickenson

merge toby_directorystorage_tests_branch. Inhibit tests that use versions when...

merge toby_directorystorage_tests_branch. Inhibit tests that use versions when not supported by the storage. Allow a subclass to insert a pause between consecutive packs if needed. DirectoryStorage now passes all the ZODB tests.
parent f0b29638
......@@ -72,6 +72,8 @@ class HistoryStorage:
eq(d['version'], '')
def checkVersionHistory(self):
if not self._storage.supportsVersions():
return
eq = self.assertEqual
# Store a couple of non-version revisions
oid = self._storage.new_oid()
......@@ -110,6 +112,8 @@ class HistoryStorage:
eq(d['version'], '')
def checkHistoryAfterVersionCommit(self):
if not self._storage.supportsVersions():
return
eq = self.assertEqual
# Store a couple of non-version revisions
oid = self._storage.new_oid()
......@@ -168,6 +172,8 @@ class HistoryStorage:
eq(d['version'], '')
def checkHistoryAfterVersionAbort(self):
if not self._storage.supportsVersions():
return
eq = self.assertEqual
# Store a couple of non-version revisions
oid = self._storage.new_oid()
......
......@@ -28,7 +28,8 @@ class PersistentStorage:
self._dostore()
oid = self._storage.new_oid()
revid = self._dostore(oid)
self._dostore(oid, revid, data=8, version='b')
if self._storage.supportsVersions():
self._dostore(oid, revid, data=8, version='b')
oid = self._storage.new_oid()
revid = self._dostore(oid, data=1)
revid = self._dostore(oid, revid, data=2)
......
......@@ -46,10 +46,12 @@ class ReadOnlyStorage:
t = Transaction()
self.assertRaises(ReadOnlyError, self._storage.tpc_begin, t)
self.assertRaises(ReadOnlyError, self._storage.abortVersion,
'', t)
self.assertRaises(ReadOnlyError, self._storage.commitVersion,
'', '', t)
if self._storage.supportsVersions():
self.assertRaises(ReadOnlyError, self._storage.abortVersion,
'', t)
self.assertRaises(ReadOnlyError, self._storage.commitVersion,
'', '', t)
self.assertRaises(ReadOnlyError, self._storage.store,
'\000' * 8, None, '', '', t)
......
......@@ -619,6 +619,7 @@ class TransactionalUndoStorage:
obj = root["key%d" % i]
self.assertEqual(obj.value, i)
root.items()
self._inter_pack_pause()
def checkPackAfterUndoManyTimes(self):
db = DB(self._storage)
......@@ -658,6 +659,12 @@ class TransactionalUndoStorage:
# never change that.
self.assertEqual(rt["test"].value, 3)
self.assertEqual(rt["test2"].value, 2)
self._inter_pack_pause()
def _inter_pack_pause(self):
# DirectoryStorage needs a pause between packs,
# most other storages dont.
pass
def checkTransactionalUndoIterator(self):
# check that data_txn set in iterator makes sense
......
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