예제 #1
0
    def test_run_hookable_mixin(self):
        def func():
            pass

        hook_type = "hook_type"
        mixin = utils.HookableMixin()
        mixin.add_hook(hook_type, func)
        mixin.run_hooks(hook_type)
예제 #2
0
    def test_add_hookable_mixin(self):
        def func():
            pass

        hook_type = "hook_type"
        mixin = utils.HookableMixin()
        mixin.add_hook(hook_type, func)
        self.assertTrue(hook_type in mixin._hooks_map)
        self.assertTrue(func in mixin._hooks_map[hook_type])
예제 #3
0
 def test_run_hookable_mixin(self):
     hook_type = "hook_type"
     mixin = utils.HookableMixin()
     mixin.add_hook(hook_type, self.func)
     mixin.run_hooks(hook_type)
예제 #4
0
 def test_add_hookable_mixin(self):
     hook_type = "hook_type"
     mixin = utils.HookableMixin()
     mixin.add_hook(hook_type, self.func)
     self.assertIn(hook_type, mixin._hooks_map)
     self.assertIn(self.func, mixin._hooks_map[hook_type])