MCPcopy
hub / github.com/celery/celery / test_from_dict_deep_deserialize

Method test_from_dict_deep_deserialize

t/unit/tasks/test_canvas.py:1620–1633  ·  view source on GitHub ↗
(self, subtests)

Source from the content-addressed store, hash-verified

1618 assert isinstance(rebuilt_chord, chord_type)
1619
1620 def test_from_dict_deep_deserialize(self, subtests):
1621 header = body = self.add.s(1, 2)
1622 original_chord = chord(header=header, body=body)
1623 serialized_chord = json.loads(json.dumps(original_chord))
1624 deserialized_chord = chord.from_dict(serialized_chord)
1625 with subtests.test(msg="Verify chord is deserialized"):
1626 assert isinstance(deserialized_chord, chord)
1627 with subtests.test(msg="Validate chord header tasks is deserialized"):
1628 assert all(
1629 isinstance(child_task, Signature)
1630 for child_task in deserialized_chord.tasks
1631 )
1632 with subtests.test(msg="Verify chord body is deserialized"):
1633 assert isinstance(deserialized_chord.body, Signature)
1634
1635 @pytest.mark.parametrize("group_type", [group, group_subclass])
1636 def test_from_dict_deep_deserialize_group(self, subtests, group_type):

Callers

nothing calls this directly

Calls 4

chordFunction · 0.85
testMethod · 0.80
sMethod · 0.45
from_dictMethod · 0.45

Tested by

no test coverage detected