Exemple #1
0
 def test_remote_hook(self):
     hooks.register_hook('bar', 'baz', 'zuz')
     hooks.remove_hook('bar', 'baz', 'zuz')
     self.assertDictEqual(hooks.get_hook_table('bar'), {'baz': []})
Exemple #2
0
 def test_hook_decorator(self):
     @hooks.hook('foo', 'bar')
     def test(): pass
     t = hooks.get_hook_table('foo')
     self.assertDictEqual(t, {'bar': [test]})
Exemple #3
0
 def test_register_hook(self):
     ''' '''
     hooks.register_hook('bar', 'baz', 'zuz')
     self.assertDictEqual(hooks.get_hook_table('bar'), {'baz': ['zuz']})