def test_chord_tasks(self): sigs = [celery_canvas.Signature() for r in range(4)] barrier = celery_canvas.Signature() chord = celery_canvas.chord(sigs, barrier) body, tasks = inspect.get_chord_tasks(chord) assert tasks == sigs assert body == barrier
def some_sigs(self): sigs = [ celery_canvas.Signature(task_id='task-{}'.format(r)) for r in range(10) ] for sig in sigs: sig.freeze() return sigs
def __call__(self, *args: Any, **kwargs: Any) -> str: self.func(*args, **kwargs) s = canvas.Signature(args=args, kwargs=kwargs, task=self.name, app=self.app, task_type=self.app.Task, routing_key=self.name) result: AsyncResult = s.apply_async() return result.id
def test_add_celery_signature(self): wf = Workflow() sig = celery_canvas.Signature() res = wf.add_celery_signature(sig) node = res[0] assert node.id == sig.id
def test_signature_freeze(self): # perhaps this isn't the best place for this test, # it verifies whether freeze() still works as expected - assignes id sig = celery_canvas.Signature() sig.freeze() assert sig.id
def test_group_tasks(self): sigs = [celery_canvas.Signature() for r in range(4)] group = celery_canvas.group(sigs) tasks = inspect.get_group_tasks(group) assert tasks == sigs
def test_chain_tasks(self): sigs = [celery_canvas.Signature() for r in range(4)] chain = celery_canvas.chain(sigs) tasks = inspect.get_chain_tasks(chain) assert sigs == tasks