/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/per_versionedfile.py

Merge trunk, address review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
    VirtualVersionedFiles,
66
66
    make_versioned_files_factory,
67
67
    )
68
 
from ..bzr.weave import WeaveFile
 
68
from ..bzr.weave import (
 
69
    WeaveFile,
 
70
    WeaveInvalidChecksum,
 
71
    )
69
72
from ..bzr.weavefile import write_weave
70
73
from .scenarios import load_tests_apply_scenarios
71
74
 
616
619
        w = self.get_file_corrupted_text()
617
620
 
618
621
        self.assertEqual('hello\n', w.get_text('v1'))
619
 
        self.assertRaises(errors.WeaveInvalidChecksum, w.get_text, 'v2')
620
 
        self.assertRaises(errors.WeaveInvalidChecksum, w.get_lines, 'v2')
621
 
        self.assertRaises(errors.WeaveInvalidChecksum, w.check)
 
622
        self.assertRaises(WeaveInvalidChecksum, w.get_text, 'v2')
 
623
        self.assertRaises(WeaveInvalidChecksum, w.get_lines, 'v2')
 
624
        self.assertRaises(WeaveInvalidChecksum, w.check)
622
625
 
623
626
        w = self.get_file_corrupted_checksum()
624
627
 
625
628
        self.assertEqual('hello\n', w.get_text('v1'))
626
 
        self.assertRaises(errors.WeaveInvalidChecksum, w.get_text, 'v2')
627
 
        self.assertRaises(errors.WeaveInvalidChecksum, w.get_lines, 'v2')
628
 
        self.assertRaises(errors.WeaveInvalidChecksum, w.check)
 
629
        self.assertRaises(WeaveInvalidChecksum, w.get_text, 'v2')
 
630
        self.assertRaises(WeaveInvalidChecksum, w.get_lines, 'v2')
 
631
        self.assertRaises(WeaveInvalidChecksum, w.check)
629
632
 
630
633
    def get_file_corrupted_text(self):
631
634
        """Return a versioned file with corrupt text but valid metadata."""