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