MCPcopy
hub / github.com/celery/celery / test_chord_clone_kwargs

Method test_chord_clone_kwargs

t/unit/tasks/test_canvas.py:1721–1736  ·  view source on GitHub ↗

Test that chord clone ensures the kwargs are the same

(self, subtests)

Source from the content-addressed store, hash-verified

1719 assert isinstance(deserialized_chord.body, _chain)
1720
1721 def test_chord_clone_kwargs(self, subtests):
1722 """ Test that chord clone ensures the kwargs are the same """
1723
1724 with subtests.test(msg='Verify chord cloning clones kwargs correctly'):
1725 c = chord([signature('g'), signature('h')], signature('i'), kwargs={'U': 6})
1726 c2 = c.clone()
1727 assert c2.kwargs == c.kwargs
1728
1729 with subtests.test(msg='Cloning the chord with overridden kwargs'):
1730 override_kw = {'X': 2}
1731 c3 = c.clone(args=(1,), kwargs=override_kw)
1732
1733 with subtests.test(msg='Verify the overridden kwargs were cloned correctly'):
1734 new_kw = c.kwargs.copy()
1735 new_kw.update(override_kw)
1736 assert c3.kwargs == new_kw
1737
1738 def test_flag_allow_error_cb_on_chord_header(self, subtests):
1739 header_mock = [Mock(name='t1'), Mock(name='t2')]

Callers

nothing calls this directly

Calls 6

signatureFunction · 0.90
chordFunction · 0.85
testMethod · 0.80
copyMethod · 0.80
cloneMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected