614
614
w = self.get_file_corrupted_text()
616
616
self.assertEqual('hello\n', w.get_text('v1'))
617
self.assertRaises(errors.VersionedFileInvalidChecksum, w.get_text, 'v2')
618
self.assertRaises(errors.VersionedFileInvalidChecksum, w.get_lines, 'v2')
619
self.assertRaises(errors.VersionedFileInvalidChecksum, w.check)
617
self.assertRaises(errors.WeaveInvalidChecksum, w.get_text, 'v2')
618
self.assertRaises(errors.WeaveInvalidChecksum, w.get_lines, 'v2')
619
self.assertRaises(errors.WeaveInvalidChecksum, w.check)
621
621
w = self.get_file_corrupted_checksum()
623
623
self.assertEqual('hello\n', w.get_text('v1'))
624
self.assertRaises(errors.VersionedFileInvalidChecksum, w.get_text, 'v2')
625
self.assertRaises(errors.VersionedFileInvalidChecksum, w.get_lines, 'v2')
626
self.assertRaises(errors.VersionedFileInvalidChecksum, w.check)
624
self.assertRaises(errors.WeaveInvalidChecksum, w.get_text, 'v2')
625
self.assertRaises(errors.WeaveInvalidChecksum, w.get_lines, 'v2')
626
self.assertRaises(errors.WeaveInvalidChecksum, w.check)
628
628
def get_file_corrupted_text(self):
629
629
"""Return a versioned file with corrupt text but valid metadata."""