test_azure_batch_10.py 458 B

1234567
  1. def test_add_single_task_to_job(self, mock_batch):
  2. hook = AzureBatchHook(azure_batch_conn_id=self.test_vm_conn_id)
  3. mock_instance = mock_batch.return_value.task.add
  4. task = hook.configure_task(task_id="mytask", command_line="echo hello")
  5. hook.add_single_task_to_job(job_id='myjob', task=task)
  6. assert isinstance(task, batch_models.TaskAddParameter)
  7. mock_instance.assert_called_once_with(job_id="myjob", task=task)