Commit 5abd9731 authored by Tim Peters's avatar Tim Peters

populate(): A number in a comment was off by a factor of 10.

testNoDamage():  Verify that the recovered .fs is in fact identical
to the original .fs.
parent f42a11d0
......@@ -55,8 +55,7 @@ class RecoverTest(unittest.TestCase):
cn = db.open()
rt = cn.root()
# create a whole bunch of objects,
# looks like a Data.fs > 1MB
# Create a bunch of objects; the Data.fs is about 100KB.
for i in range(50):
d = rt[i] = PersistentMapping()
transaction.commit()
......@@ -85,7 +84,7 @@ class RecoverTest(unittest.TestCase):
sys.stdout = faux_stdout
try:
recover(self.path, self.dest,
verbose=0, partial=1, force=0, pack=1)
verbose=0, partial=True, force=False, pack=1)
except SystemExit:
raise RuntimeError, "recover tried to exit"
finally:
......@@ -103,6 +102,18 @@ class RecoverTest(unittest.TestCase):
self.assert_('error' not in output, output)
self.assert_('\n0 bytes removed during recovery' in output, output)
# Verify that the recovered database is identical to the original.
before = file(self.path, 'rb')
before_guts = before.read()
before.close()
after = file(self.dest, 'rb')
after_guts = after.read()
after.close()
self.assertEqual(before_guts, after_guts,
"recovery changed a non-damaged .fs file")
def testOneBlock(self):
for i in range(self.ITERATIONS):
self.damage(1, 1024)
......
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