def add_hello_failed_events( context_builder: ContextBuilder, id_: int, reason: str, details: str): context_builder.add_task_scheduled_event(name='Hello', id_=id_) context_builder.add_orchestrator_completed_event() context_builder.add_orchestrator_started_event() context_builder.add_task_failed_event( id_=id_, reason=reason, details=details)
def add_failed_http_events(context_builder: ContextBuilder, id_: int, reason: str, details: str): context_builder.add_task_scheduled_event(name=HTTP_ACTION_NAME, id_=id_) context_builder.add_orchestrator_completed_event() context_builder.add_orchestrator_started_event() context_builder.add_task_failed_event(id_=id_, reason=reason, details=details)
def _fail_events(context: ContextBuilder, id_counter: int) -> Tuple[ContextBuilder, int]: """Add event failed to the context. Parameters ---------- context: ContextBuilder Orchestration context mock, to which we'll add the event completion events id_counter: int The current event counter Returns ------- Tuple[ContextBuilder, int]: The updated context, the updated id_counter """ context.add_orchestrator_started_event() for id_ in scheduled_ids: context.add_task_failed_event(id_=id_, reason=REASONS, details=DETAILS) id_counter += 1 return context, id_counter