Example #1
0
 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()
Example #2
0
 def test_execute_hooks_with_list_with_non_hook_objects(self):
     execute_hooks([None, "string", 1, True])
Example #3
0
 def test_execute_hooks_with_single_hook(self):
     hook = MagicMock(spec=Hook)
     execute_hooks([hook])
     hook.run.called_once_with()
Example #4
0
 def test_execute_hooks_with_not_a_list(self):
     execute_hooks(None)
Example #5
0
 def test_execute_hooks_with_empty_list(self):
     execute_hooks([])
Example #6
0
 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()
Example #7
0
 def test_execute_hooks_with_single_hook(self):
     hook = MagicMock(spec=Hook)
     execute_hooks([hook])
     hook.run.called_once_with()
Example #8
0
 def test_execute_hooks_with_list_with_non_hook_objects(self):
     execute_hooks([None, "string", 1, True])
Example #9
0
 def test_execute_hooks_with_empty_list(self):
     execute_hooks([])
Example #10
0
 def test_execute_hooks_with_not_a_list(self):
     execute_hooks(None)