Example #1
0
 def test_process_1_no_kill_with_wrong_case(self):
     process_handler.terminate_processes_matching_names('Process_1',
                                                        kill=True)
     self.assertEqual(0, self.mock.terminate_process.call_count)
Example #2
0
 def test_no_process_kill_with_partial_match(self):
     process_handler.terminate_processes_matching_names('process_',
                                                        kill=True)
     self.assertEqual(0, self.mock.terminate_process.call_count)
Example #3
0
 def test_no_process_kill(self):
     process_handler.terminate_processes_matching_names('not_exist',
                                                        kill=True)
     self.assertEqual(0, self.mock.terminate_process.call_count)
Example #4
0
 def test_process_2_with_kill(self):
     process_handler.terminate_processes_matching_names('process_2',
                                                        kill=True)
     self.mock.terminate_process.assert_has_calls([
         mock.call(2, True),
     ])
Example #5
0
 def test_process_2_with_terminate(self):
     process_handler.terminate_processes_matching_names('process_2')
     self.mock.terminate_process.assert_has_calls([
         mock.call(2, False),
     ])
Example #6
0
def stop_qemu():
  """Stop qemu."""
  process_handler.terminate_processes_matching_names('qemu-system-x86_64')