示例#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)