/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: John Arbash Meinel
  • Date: 2010-01-05 04:30:07 UTC
  • mfrom: (4932 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4934.
  • Revision ID: john@arbash-meinel.com-20100105043007-ehgbldqd3q0gtyws
Merge bzr.dev, resolve conflicts.

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