/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/test_branch.py

  • Committer: Marco Pantaleoni
  • Date: 2010-03-25 14:22:41 UTC
  • mto: This revision was merged to the branch mainline in revision 5174.
  • Revision ID: panta@elasticworld.org-20100325142241-vtl1hshva7uiz3ap
Applied suggestions from merge reviewer (John A Meinel):

- removed duplication of checks for presence of hooks.
- adapted to bazaar style guideline
- simplified test cases callback

Show diffs side-by-side

added added

removed removed

Lines of Context:
482
482
 
483
483
    def test_post_branch_init_hook(self):
484
484
        calls = []
485
 
        _mod_branch.Branch.hooks.install_named_hook('post_branch_init', lambda params, c=calls: c.append(params), None)
 
485
        _mod_branch.Branch.hooks.install_named_hook('post_branch_init',
 
486
            calls.append, None)
486
487
        self.assertLength(0, calls)
487
488
        branch = self.make_branch('a')
488
489
        self.assertLength(1, calls)
494
495
    def test_post_switch_hook(self):
495
496
        from bzrlib import switch
496
497
        calls = []
497
 
        _mod_branch.Branch.hooks.install_named_hook('post_switch', lambda params, c=calls: c.append(params), None)
 
498
        _mod_branch.Branch.hooks.install_named_hook('post_switch',
 
499
            calls.append, None)
498
500
        tree = self.make_branch_and_tree('branch-1')
499
501
        self.build_tree(['branch-1/file-1'])
500
502
        tree.add('file-1')