Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLM-2: Adding unit tests to chord clone #7668

Merged
merged 3 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ htmlcov/
coverage.xml
test.db
pip-wheel-metadata/
.python-version
.vscode/
17 changes: 17 additions & 0 deletions t/unit/tasks/test_canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,23 @@ def test_from_dict_deep_deserialize_chain(self, subtests):
):
assert isinstance(deserialized_chord.body, _chain)

def test_chord_clone_kwargs(self, subtests):
""" Test that chord clone ensures the kwargs are the same """

with subtests.test(msg='Verify chord cloning clones kwargs correctly'):
c = chord([signature('g'), signature('h')], signature('i'), kwargs={'U': 6})
c2 = c.clone()
assert c2.kwargs == c.kwargs

with subtests.test(msg='Cloning the chord with overridden kwargs'):
override_kw = {'X': 2}
c3 = c.clone(args=(1,), kwargs=override_kw)

with subtests.test(msg='Verify the overridden kwargs were cloned correctly'):
new_kw = c.kwargs.copy()
new_kw.update(override_kw)
assert c3.kwargs == new_kw


class test_maybe_signature(CanvasCase):

Expand Down