MCPcopy
hub / github.com/celery/celery / test_GroupResult_as_tuple

Method test_GroupResult_as_tuple

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

Source from the content-addressed store, hash-verified

1042 assert second_result.parent == parent
1043
1044 def test_GroupResult_as_tuple(self):
1045 parent = self.app.AsyncResult(uuid())
1046 result = self.app.GroupResult(
1047 'group-result-1',
1048 [self.app.AsyncResult(f'async-result-{i}')
1049 for i in range(2)],
1050 parent
1051 )
1052 (result_id, parent_tuple), group_results = result.as_tuple()
1053 assert result_id == result.id
1054 assert parent_tuple == parent.as_tuple()
1055 assert parent_tuple[0][0] == parent.id
1056 assert isinstance(group_results, list)
1057 expected_grp_res = [((f'async-result-{i}', None), None)
1058 for i in range(2)]
1059 assert group_results == expected_grp_res

Callers

nothing calls this directly

Calls 4

as_tupleMethod · 0.95
as_tupleMethod · 0.95
GroupResultMethod · 0.80
AsyncResultMethod · 0.45

Tested by

no test coverage detected