/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_errors.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-10 16:40:42 UTC
  • mfrom: (6653.6.7 rename-controldir)
  • mto: This revision was merged to the branch mainline in revision 6690.
  • Revision ID: jelmer@jelmer.uk-20170610164042-zrxqgy2htyduvke2
MergeĀ rename-controldirĀ branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
613
613
            def open_repository(self):
614
614
                # str() on the NotBranchError will trigger a call to this,
615
615
                # which in turn will another, identical NotBranchError.
616
 
                raise errors.NotBranchError('path', bzrdir=FakeBzrDir())
617
 
        err = errors.NotBranchError('path', bzrdir=FakeBzrDir())
 
616
                raise errors.NotBranchError('path', controldir=FakeBzrDir())
 
617
        err = errors.NotBranchError('path', controldir=FakeBzrDir())
618
618
        self.assertEqual('Not a branch: "path": NotBranchError.', str(err))
619
619
 
620
620
    def test_invalid_pattern(self):
720
720
        error = errors.CorruptRepository(repo)
721
721
        self.assertEqualDiff("An error has been detected in the repository %s.\n"
722
722
                             "Please run brz reconcile on this repository." %
723
 
                             repo.bzrdir.root_transport.base,
 
723
                             repo.controldir.root_transport.base,
724
724
                             str(error))
725
725
 
726
726
    def test_unknown_bug_tracker_abbreviation(self):
732
732
            str(error))
733
733
 
734
734
    def test_not_branch_bzrdir_with_repo(self):
735
 
        bzrdir = self.make_repository('repo').bzrdir
736
 
        err = errors.NotBranchError('path', bzrdir=bzrdir)
 
735
        controldir = self.make_repository('repo').controldir
 
736
        err = errors.NotBranchError('path', controldir=controldir)
737
737
        self.assertEqual(
738
738
            'Not a branch: "path": location is a repository.', str(err))
739
739
 
740
740
    def test_not_branch_bzrdir_without_repo(self):
741
 
        bzrdir = self.make_bzrdir('bzrdir')
742
 
        err = errors.NotBranchError('path', bzrdir=bzrdir)
 
741
        controldir = self.make_controldir('bzrdir')
 
742
        err = errors.NotBranchError('path', controldir=controldir)
743
743
        self.assertEqual('Not a branch: "path".', str(err))
744
744
 
745
745
    def test_not_branch_laziness(self):
746
 
        real_bzrdir = self.make_bzrdir('path')
 
746
        real_bzrdir = self.make_controldir('path')
747
747
        class FakeBzrDir(object):
748
748
            def __init__(self):
749
749
                self.calls = []
751
751
                self.calls.append('open_repository')
752
752
                raise errors.NoRepositoryPresent(real_bzrdir)
753
753
        fake_bzrdir = FakeBzrDir()
754
 
        err = errors.NotBranchError('path', bzrdir=fake_bzrdir)
 
754
        err = errors.NotBranchError('path', controldir=fake_bzrdir)
755
755
        self.assertEqual([], fake_bzrdir.calls)
756
756
        str(err)
757
757
        self.assertEqual(['open_repository'], fake_bzrdir.calls)