MCPcopy
hub / github.com/celery/celery / test_join_native

Method test_join_native

t/unit/tasks/test_result.py:793–807  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

791 GroupResult.restore(ts.id)
792
793 def test_join_native(self):
794 backend = SimpleBackend()
795 results = [self.app.AsyncResult(uuid(), backend=backend)
796 for i in range(10)]
797 ts = self.app.GroupResult(uuid(), results)
798
799 with patch('celery.Celery.backend', new=backend):
800 backend.ids = [result.id for result in results]
801 res = ts.join_native()
802 assert res == list(range(10))
803 callback = Mock(name='callback')
804 assert not ts.join_native(callback=callback)
805 callback.assert_has_calls([
806 call(r.id, i) for i, r in enumerate(ts.results)
807 ])
808
809 def test_join_native_raises(self):
810 ts = self.app.GroupResult(uuid(), [self.app.AsyncResult(uuid())])

Callers

nothing calls this directly

Calls 5

SimpleBackendClass · 0.85
callFunction · 0.85
GroupResultMethod · 0.80
join_nativeMethod · 0.80
AsyncResultMethod · 0.45

Tested by

no test coverage detected