Skip to content

Commit

Permalink
test: update test_patch_work_item_grouped_links test
Browse files Browse the repository at this point in the history
  • Loading branch information
micha91 committed Nov 29, 2023
1 parent 125c3ea commit b9e24fd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,14 @@ def test_patch_work_item_grouped_links(
obj.uuid
].linked_work_items

def mock_back_link(work_item, back_links):
back_links[work_item.id] = []

mock_grouped_links = mock.MagicMock()
monkeypatch.setattr(
element, "create_grouped_link_fields", mock_grouped_links
)
mock_grouped_links.side_effect = mock_back_link

mock_grouped_links_reverse = mock.MagicMock()
monkeypatch.setattr(
Expand All @@ -542,6 +546,7 @@ def test_patch_work_item_grouped_links(
mock_grouped_links_calls = mock_grouped_links.call_args_list

assert len(mock_grouped_links_calls) == 3
assert mock_grouped_links_reverse.call_count == 3

assert mock_grouped_links_calls[0][0][0] == dummy_work_items["uuid0"]
assert mock_grouped_links_calls[1][0][0] == dummy_work_items["uuid1"]
Expand Down

0 comments on commit b9e24fd

Please sign in to comment.