~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_errors.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-01-11 15:45:55 UTC
  • mfrom: (5588.1.1 bzr.dev)
  • Revision ID: pqm@pqm.ubuntu.com-20110111154555-xmu386vs0qoigyhl
(vila) Document the packaging helper scripts. (Max Bowsher)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    bzrdir,
26
26
    errors,
27
27
    osutils,
28
 
    symbol_versioning,
29
28
    urlutils,
30
29
    )
31
 
from bzrlib.tests import TestCase, TestCaseWithTransport, TestSkipped
 
30
from bzrlib.tests import (
 
31
    TestCase,
 
32
    TestCaseWithTransport,
 
33
    TestSkipped,
 
34
    )
32
35
 
33
36
 
34
37
class TestErrors(TestCaseWithTransport):
672
675
        err = errors.NotBranchError('path', bzrdir=bzrdir)
673
676
        self.assertEqual('Not a branch: "path".', str(err))
674
677
 
 
678
    def test_not_branch_bzrdir_with_recursive_not_branch_error(self):
 
679
        class FakeBzrDir(object):
 
680
            def open_repository(self):
 
681
                # str() on the NotBranchError will trigger a call to this,
 
682
                # which in turn will another, identical NotBranchError.
 
683
                raise errors.NotBranchError('path', bzrdir=FakeBzrDir())
 
684
        err = errors.NotBranchError('path', bzrdir=FakeBzrDir())
 
685
        self.assertEqual('Not a branch: "path".', str(err))
 
686
 
675
687
    def test_not_branch_laziness(self):
676
688
        real_bzrdir = self.make_bzrdir('path')
677
689
        class FakeBzrDir(object):