[Zope-Checkins] CVS: ZODB3/ZODB/tests - testFileStorage.py:1.20
Barry Warsaw
barry@wooz.org
Thu, 24 Oct 2002 09:51:56 -0400
Update of /cvs-repository/ZODB3/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv17288
Modified Files:
testFileStorage.py
Log Message:
Refactor some non-FileStorage specific tests into RecoveryStorage.
=== ZODB3/ZODB/tests/testFileStorage.py 1.19 => 1.20 ===
--- ZODB3/ZODB/tests/testFileStorage.py:1.19 Wed Aug 14 18:07:09 2002
+++ ZODB3/ZODB/tests/testFileStorage.py Thu Oct 24 09:51:56 2002
@@ -11,7 +11,7 @@
TransactionalUndoVersionStorage, PackableStorage, \
Synchronization, ConflictResolution, HistoryStorage, \
IteratorStorage, Corruption, RevisionStorage, PersistentStorage, \
- MTStorage, ReadOnlyStorage
+ MTStorage, ReadOnlyStorage, RecoveryStorage
class FileStorageTests(
StorageTestBase.StorageTestBase,
@@ -63,7 +63,7 @@
class FileStorageRecoveryTest(
StorageTestBase.StorageTestBase,
- IteratorStorage.IteratorDeepCompare,
+ RecoveryStorage.RecoveryStorage,
):
def setUp(self):
@@ -75,55 +75,6 @@
self._dst.close()
StorageTestBase.removefs("Source.fs")
StorageTestBase.removefs("Dest.fs")
-
- def checkSimpleRecovery(self):
- oid = self._storage.new_oid()
- revid = self._dostore(oid, data=11)
- revid = self._dostore(oid, revid=revid, data=12)
- revid = self._dostore(oid, revid=revid, data=13)
- self._dst.copyTransactionsFrom(self._storage)
- self.compare(self._storage, self._dst)
-
- def checkRecoveryAcrossVersions(self):
- oid = self._storage.new_oid()
- revid = self._dostore(oid, data=21)
- revid = self._dostore(oid, revid=revid, data=22)
- revid = self._dostore(oid, revid=revid, data=23, version='one')
- revid = self._dostore(oid, revid=revid, data=34, version='one')
- # Now commit the version
- t = Transaction()
- self._storage.tpc_begin(t)
- self._storage.commitVersion('one', '', t)
- self._storage.tpc_vote(t)
- self._storage.tpc_finish(t)
- self._dst.copyTransactionsFrom(self._storage)
- self.compare(self._storage, self._dst)
-
- def checkRecoverAbortVersion(self):
- oid = self._storage.new_oid()
- revid = self._dostore(oid, data=21, version="one")
- revid = self._dostore(oid, revid=revid, data=23, version='one')
- revid = self._dostore(oid, revid=revid, data=34, version='one')
- # Now abort the version and the creation
- t = Transaction()
- self._storage.tpc_begin(t)
- oids = self._storage.abortVersion('one', t)
- self._storage.tpc_vote(t)
- self._storage.tpc_finish(t)
- self.assertEqual(oids, [oid])
- self._dst.copyTransactionsFrom(self._storage)
- self.compare(self._storage, self._dst)
- # Also make sure the the last transaction has a data record
- # with None for its data attribute, because we've undone the
- # object.
- for s in self._storage, self._dst:
- iter = s.iterator()
- for trans in iter:
- pass # iterate until we get the last one
- data = trans[0]
- self.assertRaises(IndexError, lambda i:trans[i], 1)
- self.assertEqual(data.oid, oid)
- self.assertEqual(data.data, None)
def test_suite():