Beispiel #1
0
    def test_start_task_deletes_and_launches_job_when_finished_existing_job(self, mock_job_launch, mock_delete_job, mock_get_job, mock_get_task):
        job_processor.start_task()

        mock_get_task.assert_called_once_with()
        mock_get_job.assert_called_once_with(valid_task_definition)
        mock_delete_job.assert_called_once_with(valid_task_definition)
        mock_job_launch.assert_called_once_with(valid_task_definition)
Beispiel #2
0
    def test_start_task_no_ops_when_running_job(self, mock_job_launch, mock_delete_job, mock_get_job, mock_get_task):
        job_processor.start_task()

        mock_get_task.assert_called_once_with()
        mock_get_job.assert_called_once_with(valid_task_definition)
        mock_delete_job.assert_not_called()
        mock_job_launch.assert_not_called()
Beispiel #3
0
    def test_start_task_launches_job_when_no_existing_job(
            self, mock_job_launch, mock_delete_job, mock_get_job,
            mock_get_task, mock_lpopsync):
        job_processor.start_task()

        mock_get_task.assert_called_once_with()
        mock_get_job.assert_called_once_with(valid_task_definition)
        mock_delete_job.assert_not_called()
        mock_job_launch.assert_called_once_with(valid_task_definition)
        mock_lpopsync.assert_called_once()