def test_create_jobs_from_operator_pipeline_deleted( self, get_pipeline_id, get_jobs, send_notification, create_run_task, memcache_task_lock, set_for_restart ): argos_jobs = list() argos_jobs.append(RunCreator(app="cb5d793b-e650-4b7d-bfcd-882858e29cc5", inputs=None, name=None, tags={})) set_for_restart.return_value = None get_jobs.return_value = argos_jobs get_pipeline_id.return_value = None create_run_task.return_value = None send_notification.return_value = None memcache_task_lock.return_value = True Run.objects.all().delete() operator = OperatorFactory.get_by_model(Operator.objects.get(id=1), request_id="bar") create_jobs_from_operator(operator, None) self.assertEqual(len(Run.objects.all()), 1) self.assertEqual(RunStatus(Run.objects.first().status), RunStatus.FAILED)
def get_status(self, obj): return RunStatus(obj.status).name
def __repr__(self): return "(RUN) %s: status: %s" % (self.run_id, RunStatus( self.status).name)