~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_weave.py

PumpĀ inĀ changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
705
705
        w = read_weave(tmpf)
706
706
 
707
707
        self.assertEqual('hello\n', w.get_text('v1'))
708
 
        self.assertRaises(errors.VersionedFileInvalidChecksum, w.get_text, 'v2')
709
 
        self.assertRaises(errors.VersionedFileInvalidChecksum, w.get_lines, 'v2')
710
 
        self.assertRaises(errors.VersionedFileInvalidChecksum, w.check)
 
708
        self.assertRaises(errors.WeaveInvalidChecksum, w.get_text, 'v2')
 
709
        self.assertRaises(errors.WeaveInvalidChecksum, w.get_lines, 'v2')
 
710
        self.assertRaises(errors.WeaveInvalidChecksum, w.check)
711
711
 
712
712
        # Change the sha checksum
713
713
        tmpf = StringIO('# bzr weave file v5\n'
718
718
        w = read_weave(tmpf)
719
719
 
720
720
        self.assertEqual('hello\n', w.get_text('v1'))
721
 
        self.assertRaises(errors.VersionedFileInvalidChecksum, w.get_text, 'v2')
722
 
        self.assertRaises(errors.VersionedFileInvalidChecksum, w.get_lines, 'v2')
723
 
        self.assertRaises(errors.VersionedFileInvalidChecksum, w.check)
 
721
        self.assertRaises(errors.WeaveInvalidChecksum, w.get_text, 'v2')
 
722
        self.assertRaises(errors.WeaveInvalidChecksum, w.get_lines, 'v2')
 
723
        self.assertRaises(errors.WeaveInvalidChecksum, w.check)
724
724
 
725
725
 
726
726
class TestWeave(TestCase):
773
773
    def test_empty_file(self):
774
774
        f = open('empty.weave', 'wb+')
775
775
        try:
776
 
            self.assertRaises(WeaveFormatError, read_weave, f)
 
776
            self.assertRaises(errors.WeaveFormatError,
 
777
                              read_weave, f)
777
778
        finally:
778
779
            f.close()