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

  • Committer: Daniel Watkins
  • Date: 2008-03-08 18:25:44 UTC
  • mto: (3276.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 3277.
  • Revision ID: d.m.watkins@warwick.ac.uk-20080308182544-sw9fi33k7wu5rku7
Added hook to ensure that 'bzr hooks' can deal with named plugins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
        out, err = self.run_bzr('hooks')
42
42
        self._check_hooks_output(out, {'set_rh': ["No hook name"]})
43
43
 
 
44
    def test_hooks_with_named_hook(self):
 
45
        self.make_branch('.')
 
46
        def foo(): return
 
47
        name = "Foo Bar Hook"
 
48
        Branch.hooks.install_hook('set_rh', foo)
 
49
        Branch.hooks.name_hook(foo, name)
 
50
        out, err = self.run_bzr('hooks')
 
51
        self._check_hooks_output(out, {'set_rh': [name]})
 
52
 
44
53
    def test_hooks_no_branch(self):
45
54
        self.run_bzr('hooks', retcode=3)