Commit 213adbb2 authored by Barry Warsaw's avatar Barry Warsaw

FullOpenExistingTest(): Two new tests to tickle a bug when opening a

database that had existing versions.  Bug (typo really) fixed in v1.28
of Full.py.
parent 48c3a976
......@@ -23,11 +23,44 @@ class FullCreateTest(BerkeleyTestBase.BerkeleyTestBase,
pass
class FullOpenExistingTest(BerkeleyTestBase.BerkeleyTestBase,
BerkeleyTestBase.FullTestBase):
def checkOpenWithExistingVersions(self):
version = 'test-version'
oid = self._storage.new_oid()
revid = self._dostore(oid, data=7, version=version)
# Now close the current storage and re-open it
self._storage.close()
self._storage = self.ConcreteStorage(BerkeleyTestBase.DBHOME)
assert self._storage.modifiedInVersion(oid) == version
def checkOpenAddVersion(self):
version1 = 'test-version'
oid1 = self._storage.new_oid()
revid = self._dostore(oid1, data=7, version=version1)
# Now close the current storage and re-open it
self._storage.close()
self._storage = self.ConcreteStorage(BerkeleyTestBase.DBHOME)
assert self._storage.modifiedInVersion(oid1) == version1
# Now create a 2nd version string, then close/reopen
version2 = 'new-version'
oid2 = self._storage.new_oid()
revid = self._dostore(oid2, data=8, version=version2)
# Now close the current storage and re-open it
self._storage.close()
self._storage = self.ConcreteStorage(BerkeleyTestBase.DBHOME)
assert self._storage.modifiedInVersion(oid1) == version1
# Now create a 2nd version string, then close/reopen
assert self._storage.modifiedInVersion(oid2) == version2
def suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(MinimalCreateTest, 'check'))
suite.addTest(unittest.makeSuite(FullCreateTest, 'check'))
suite.addTest(unittest.makeSuite(FullOpenExistingTest, 'check'))
return suite
......
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