~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_switch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-06-28 19:12:10 UTC
  • mfrom: (5967.7.4 rm-magic-methods)
  • Revision ID: pqm@pqm.ubuntu.com-20110628191210-bwblsxn26kyu3swl
(mbp) remove __contains__ methods from inventory and dict (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
278
278
        self.run_bzr('switch --directory checkout b')
279
279
        self.assertFileEqual('initial\nmore\n', 'checkout/a')
280
280
 
281
 
 
282
281
class TestSwitchParentLocationBase(TestCaseWithTransport):
283
282
 
284
283
    def setUp(self):
329
328
        self.assertParent('repo/trunk', bb)
330
329
        self.assertParent('repo/trunk', mb)
331
330
 
332
 
 
333
 
class TestSwitchDoesntOpenMasterBranch(TestCaseWithTransport):
334
 
    # See https://bugs.launchpad.net/bzr/+bug/812285
335
 
    # "bzr switch --create-branch" can point the new branch's parent to the
336
 
    # master branch, but it doesn't have to open it to do so.
337
 
 
338
 
    def test_switch_create_doesnt_open_master_branch(self):
339
 
        master = self.make_branch_and_tree('master')
340
 
        master.commit('one')
341
 
        # Note: not a lightweight checkout
342
 
        checkout = master.branch.create_checkout('checkout')
343
 
        opened = []
344
 
        def open_hook(branch):
345
 
            # Just append the final directory of the branch
346
 
            name = branch.base.rstrip('/').rsplit('/', 1)[1]
347
 
            opened.append(name)
348
 
        branch.Branch.hooks.install_named_hook('open', open_hook,
349
 
                                               'open_hook_logger')
350
 
        self.run_bzr('switch --create-branch -d checkout feature')
351
 
        # We only open the master branch 1 time.
352
 
        # This test should be cleaner to write, but see bug:
353
 
        #  https://bugs.launchpad.net/bzr/+bug/812295
354
 
        self.assertEqual(1, opened.count('master'))