Exemple #1
0
 def test_load_missing_name(self):
     """Wrong Hooks are not loaded."""
     context = mock.MagicMock()
     config = copy.deepcopy(CONFIG)
     del config['hooks'][0]['name']
     hm = hooks.HookManager('foo', config)
     hm.load_hooks(context)
     self.assertEqual(len(hm.hooks), 1)
Exemple #2
0
 def test_load_non_existing_hook(self):
     """Wrong Hooks are not loaded."""
     context = mock.MagicMock()
     config = copy.deepcopy(CONFIG)
     config['hooks'][0]['name'] = 'foo'
     config['hooks'][1]['name'] = 'bar'
     hm = hooks.HookManager('foo', config)
     hm.load_hooks(context)
     self.assertEqual(len(hm.hooks), 0)
Exemple #3
0
 def setUp(self):
     self.hook_manager = hooks.HookManager('foo', copy.deepcopy(CONFIG))