~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-06-28 03:12:48 UTC
  • mfrom: (5215.4.4 find-bzrdirs-missing-repos)
  • Revision ID: pqm@pqm.ubuntu.com-20100628031248-icctusovofhlk7z9
(lifeless) Do not return bzrdirs in find_bzrdirs where there is a branch
 with no repository available to it. (Marius Kruger) (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
import sys
25
25
 
26
26
from bzrlib import (
 
27
    branch,
27
28
    bzrdir,
28
29
    errors,
29
30
    help_topics,
888
889
        self.assertEqual(bar.root_transport.base, branches[1].base)
889
890
 
890
891
 
 
892
class TestMissingRepoBranchesSkipped(TestCaseWithMemoryTransport):
 
893
 
 
894
    def test_find_bzrdirs_missing_repo(self):
 
895
        transport = get_transport(self.get_url())
 
896
        arepo = self.make_repository('arepo', shared=True)
 
897
        abranch_url = arepo.user_url + '/abranch'
 
898
        abranch = bzrdir.BzrDir.create(abranch_url).create_branch()
 
899
        transport.delete_tree('arepo/.bzr')
 
900
        self.assertRaises(errors.NoRepositoryPresent,
 
901
            branch.Branch.open, abranch_url)
 
902
        self.make_branch('baz')
 
903
        for actual_bzrdir in bzrdir.BzrDir.find_branches(transport):
 
904
            self.assertEndsWith(actual_bzrdir.user_url, '/baz/')
 
905
 
 
906
 
891
907
class TestMeta1DirFormat(TestCaseWithTransport):
892
908
    """Tests specific to the meta1 dir format."""
893
909