~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_directory_service.py

  • Committer: Patch Queue Manager
  • Date: 2012-03-30 01:58:47 UTC
  • mfrom: (6511.3.2 co-alias)
  • Revision ID: pqm@pqm.ubuntu.com-20120330015847-a0usc8fbawzc1bu4
(jelmer) Add co: directory service. (Jelmer Vernooij)

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'))