MCPcopy
hub / github.com/celery/celery / test_chunks

Method test_chunks

t/unit/tasks/test_canvas.py:380–397  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

378 isinstance(chunks_subclass.from_dict(d).clone(), chunks_subclass)
379
380 def test_chunks(self):
381 x = self.add.chunks(range(100), 10)
382 assert dict(chunks.from_dict(dict(x), app=self.app)) == dict(x)
383
384 assert x.group()
385 assert len(x.group().tasks) == 10
386
387 x.group = Mock()
388 gr = x.group.return_value = Mock()
389
390 x.apply_async()
391 gr.apply_async.assert_called_with((), {}, route_name=self.add.name)
392 gr.apply_async.reset_mock()
393 x()
394 gr.apply_async.assert_called_with((), {}, route_name=self.add.name)
395
396 self.app.conf.task_always_eager = True
397 chunks.apply_chunks(app=self.app, **x['kwargs'])
398
399
400class test_chain(CanvasCase):

Callers

nothing calls this directly

Calls 6

xFunction · 0.85
chunksMethod · 0.80
apply_chunksMethod · 0.80
from_dictMethod · 0.45
groupMethod · 0.45
apply_asyncMethod · 0.45

Tested by

no test coverage detected