[Zodb-checkins] CVS: ZODB/src/ZODB/tests - testRecover.py:1.10
Tim Peters
tim.one at comcast.net
Tue May 4 14:23:23 EDT 2004
Update of /cvs-repository/ZODB/src/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv2178/src/ZODB/tests
Modified Files:
testRecover.py
Log Message:
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.
=== ZODB/src/ZODB/tests/testRecover.py 1.9 => 1.10 ===
--- ZODB/src/ZODB/tests/testRecover.py:1.9 Mon May 3 14:55:40 2004
+++ ZODB/src/ZODB/tests/testRecover.py Tue May 4 14:23:21 2004
@@ -55,8 +55,7 @@
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 @@
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:
@@ -102,6 +101,18 @@
output = self.recover()
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):
More information about the Zodb-checkins
mailing list