def _create_task(self, call_request, call_report=None, call_request_group_id=None): """ Create the task for the given call request. @param call_request: call request to encapsulate in a task @type call_request: L{call.CallRequest} instance @param call_report: call report for call request @type call_report: L{call.CallReport} instance or None @param call_request_group_id: optional call request group id @type call_request_group_id: None or str @return: task that encapsulates the call request @rtype: L{Task} instance """ if call_request_group_id is not None: call_request.group_id = call_request_group_id if not call_request.asynchronous: task = Task(call_request, call_report) else: task = AsyncTask(call_request, call_report) return task
def setUp(self): self.call_request = CallRequest(Call(), call_args, call_kwargs) self.call_report = CallReport() self.task = AsyncTask(self.call_request, self.call_report)
def gen_async_task(self, call=call): return AsyncTask(CallRequest(call))