def test_execute_hooks_with_multiple_hook(self): hook_1 = MagicMock(spec=Hook) hook_2 = MagicMock(spec=Hook) execute_hooks([hook_1, hook_2]) hook_1.run.called_once_with() hook_2.run.called_once_with()
def test_execute_hooks_with_list_with_non_hook_objects(self): execute_hooks([None, "string", 1, True])
def test_execute_hooks_with_single_hook(self): hook = MagicMock(spec=Hook) execute_hooks([hook]) hook.run.called_once_with()
def test_execute_hooks_with_not_a_list(self): execute_hooks(None)
def test_execute_hooks_with_empty_list(self): execute_hooks([])