Esempio n. 1
0
 def test_ensure_custom_hook_does_not_allow_built_in_hooks(self):
     with self.assertRaises(exceptions.HookAlreadyExists):
         hooks.ensure_custom_hook("test_start")
Esempio n. 2
0
 def test_ensure_custom_hook_does_not_allow_built_in_hooks(self):
     with self.assertRaises(exceptions.HookAlreadyExists):
         hooks.ensure_custom_hook("test_start")
Esempio n. 3
0
 def test_ensure_custom_hook(self):
     self.assertIs(hooks.ensure_custom_hook(self.hook_name), self.hook)
     new_hook = hooks.ensure_custom_hook("new_custom_hook")
     self.addCleanup(hooks.remove_custom_hook, "new_custom_hook")
     self.assertIs(new_hook, hooks.new_custom_hook)
Esempio n. 4
0
 def test_ensure_custom_hook(self):
     self.assertIs(hooks.ensure_custom_hook(self.hook_name), self.hook)
     new_hook = hooks.ensure_custom_hook("new_custom_hook")
     self.addCleanup(hooks.remove_custom_hook, "new_custom_hook")
     self.assertIs(new_hook, hooks.new_custom_hook)