~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_hooks.py

  • Committer: Daniel Watkins
  • Date: 2008-03-08 23:14:52 UTC
  • mto: (3394.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 3395.
  • Revision ID: d.m.watkins@warwick.ac.uk-20080308231452-zlso6a5iy2nclm2u
Modified tests to reflect install_named_hook becoming a separate method.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        hooks.install_hook('set_rh', None)
41
41
        self.assertEqual(hooks['set_rh'], [None])
42
42
 
43
 
    def test_install_hook_with_name(self):
44
 
        hooks = Hooks()
45
 
        hooks['set_rh']
46
 
        hooks.install_hook('set_rh', None, name="demo")
 
43
    def test_install_named_hook_raises_unknown_hook(self):
 
44
        hooks = Hooks()
 
45
        self.assertRaises(UnknownHook, hooks.install_named_hook, 'silly',
 
46
                          None, "")
 
47
 
 
48
    def test_install_named_hook_appends_known_hook(self):
 
49
        hooks = Hooks()
 
50
        hooks['set_rh'] = []
 
51
        hooks.install_named_hook('set_rh', None, "demo")
 
52
        self.assertEqual(hooks['set_rh'], [None])
 
53
 
 
54
    def test_install_named_hook_and_retrieve_name(self):
 
55
        hooks = Hooks()
 
56
        hooks.install_named_hook('set_rh', None, "demo")
47
57
        self.assertEqual("demo", hooks.get_hook_name(None))
48
58
 
49
59
    def test_name_hook_and_retrieve_name(self):