/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2017-06-10 18:39:27 UTC
  • mfrom: (6653.6.7 rename-controldir)
  • Revision ID: breezy.the.bot@gmail.com-20170610183927-8yn4wmsk1ki92xc3
Rename ``bzrdir`` attribute to ``controldir``.

Merged from https://code.launchpad.net/~jelmer/brz/rename-controldir/+merge/325433

Show diffs side-by-side

added added

removed removed

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