[Zodb-checkins] CVS: Zope/lib/python/ZODB/tests -
HistoryStorage.py:1.9 PersistentStorage.py:1.5
ReadOnlyStorage.py:1.6 TransactionalUndoStorage.py:1.31
Toby Dickenson
tdickenson at geminidataloggers.com
Thu May 15 04:56:43 EDT 2003
Update of /cvs-repository/Zope/lib/python/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv20979/tests
Modified Files:
HistoryStorage.py PersistentStorage.py ReadOnlyStorage.py
TransactionalUndoStorage.py
Log Message:
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.
=== Zope/lib/python/ZODB/tests/HistoryStorage.py 1.8 => 1.9 ===
--- Zope/lib/python/ZODB/tests/HistoryStorage.py:1.8 Thu Dec 5 19:00:53 2002
+++ Zope/lib/python/ZODB/tests/HistoryStorage.py Thu May 15 03:56:42 2003
@@ -72,6 +72,8 @@
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 @@
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 @@
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()
=== Zope/lib/python/ZODB/tests/PersistentStorage.py 1.4 => 1.5 ===
--- Zope/lib/python/ZODB/tests/PersistentStorage.py:1.4 Fri Dec 6 14:01:40 2002
+++ Zope/lib/python/ZODB/tests/PersistentStorage.py Thu May 15 03:56:42 2003
@@ -28,7 +28,8 @@
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)
=== Zope/lib/python/ZODB/tests/ReadOnlyStorage.py 1.5 => 1.6 ===
--- Zope/lib/python/ZODB/tests/ReadOnlyStorage.py:1.5 Thu Dec 5 19:00:53 2002
+++ Zope/lib/python/ZODB/tests/ReadOnlyStorage.py Thu May 15 03:56:42 2003
@@ -46,10 +46,12 @@
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)
=== Zope/lib/python/ZODB/tests/TransactionalUndoStorage.py 1.30 => 1.31 ===
--- Zope/lib/python/ZODB/tests/TransactionalUndoStorage.py:1.30 Thu May 8 17:57:53 2003
+++ Zope/lib/python/ZODB/tests/TransactionalUndoStorage.py Thu May 15 03:56:42 2003
@@ -619,6 +619,7 @@
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 @@
# 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
More information about the Zodb-checkins
mailing list