예제 #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': []})
예제 #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]})
예제 #3
0
 def test_register_hook(self):
     ''' '''
     hooks.register_hook('bar', 'baz', 'zuz')
     self.assertDictEqual(hooks.get_hook_table('bar'), {'baz': ['zuz']})