/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 bzrlib/tests/blackbox/test_switch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-01-14 00:01:32 UTC
  • mfrom: (4957.1.1 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100114000132-3p3rabnonjw3gzqb
(jam) Merge bzr.stable, bringing in bug fixes #175839, #504390

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
from bzrlib.workingtree import WorkingTree
24
24
from bzrlib.tests.blackbox import ExternalBase
 
25
from bzrlib.directory_service import directories
25
26
 
26
27
 
27
28
class TestSwitch(ExternalBase):
183
184
        # The new branch should have been created at the same level as
184
185
        # 'branch', because we did not have a '/' segment
185
186
        self.assertEqual(branch.base[:-1] + '2/', tree.branch.base)
 
187
 
 
188
    def test_create_branch_directory_services(self):
 
189
        branch = self.make_branch('branch')
 
190
        tree = branch.create_checkout('tree', lightweight=True)
 
191
        class FooLookup(object):
 
192
            def look_up(self, name, url):
 
193
                return 'foo-'+name
 
194
        directories.register('foo:', FooLookup, 'Create branches named foo-')
 
195
        self.addCleanup(directories.remove, 'foo:')
 
196
        self.run_bzr('switch -b foo:branch2', working_dir='tree')
 
197
        tree = WorkingTree.open('tree')
 
198
        self.assertEndsWith(tree.branch.base, 'foo-branch2/')
 
199