~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_errors.py

  • Committer: Jelmer Vernooij
  • Date: 2010-12-20 11:57:14 UTC
  • mto: This revision was merged to the branch mainline in revision 5577.
  • Revision ID: jelmer@samba.org-20101220115714-2ru3hfappjweeg7q
Don't use no-plugins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
159
159
            "cannot be broken.",
160
160
            str(error))
161
161
 
 
162
    def test_lock_corrupt(self):
 
163
        error = errors.LockCorrupt("corruption info")
 
164
        self.assertEqualDiff("Lock is apparently held, but corrupted: "
 
165
            "corruption info\n"
 
166
            "Use 'bzr break-lock' to clear it",
 
167
            str(error))
 
168
 
162
169
    def test_knit_data_stream_incompatible(self):
163
170
        error = errors.KnitDataStreamIncompatible(
164
171
            'stream format', 'target format')
665
672
        err = errors.NotBranchError('path', bzrdir=bzrdir)
666
673
        self.assertEqual('Not a branch: "path".', str(err))
667
674
 
 
675
    def test_not_branch_bzrdir_with_recursive_not_branch_error(self):
 
676
        class FakeBzrDir(object):
 
677
            def open_repository(self):
 
678
                # str() on the NotBranchError will trigger a call to this,
 
679
                # which in turn will another, identical NotBranchError.
 
680
                raise errors.NotBranchError('path', bzrdir=FakeBzrDir())
 
681
        err = errors.NotBranchError('path', bzrdir=FakeBzrDir())
 
682
        self.assertEqual('Not a branch: "path".', str(err))
 
683
 
668
684
    def test_not_branch_laziness(self):
669
685
        real_bzrdir = self.make_bzrdir('path')
670
686
        class FakeBzrDir(object):