Beispiel #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)
Beispiel #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])
 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)
 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])