~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_directory_service.py

  • Committer: Jelmer Vernooij
  • Date: 2012-03-21 13:29:11 UTC
  • mto: This revision was merged to the branch mainline in revision 6516.
  • Revision ID: jelmer@samba.org-20120321132911-3rr9q3i9k1y8so14
Tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
        AliasDirectory.branch_aliases.register("booga",
117
117
            lambda b: "UHH?", help="Nobody knows")
118
118
        self.assertEquals("UHH?", directories.dereference(":booga"))
 
119
 
 
120
 
 
121
class TestColocatedDirectory(TestCaseWithTransport):
 
122
 
 
123
    def test_lookup_non_default(self):
 
124
        default = self.make_branch('.')
 
125
        non_default = default.bzrdir.create_branch(name='nondefault')
 
126
        self.assertEquals(non_default.base, directories.dereference('co:nondefault'))
 
127
 
 
128
    def test_lookup_default(self):
 
129
        default = self.make_branch('.')
 
130
        non_default = default.bzrdir.create_branch(name='nondefault')
 
131
        self.assertEquals(urlutils.join_segment_parameters(default.bzrdir.user_url,
 
132
            {"branch": ""}), directories.dereference('co:'))
 
133
 
 
134
    def test_no_such_branch(self):
 
135
        # No error is raised in this case, that is up to the code that actually
 
136
        # opens the branch.
 
137
        default = self.make_branch('.')
 
138
        self.assertEquals(urlutils.join_segment_parameters(default.bzrdir.user_url,
 
139
            {"branch": "foo"}), directories.dereference('co:foo'))