Skip to content

Commit

Permalink
Remove test_abort_cherry_pick_fail
Browse files Browse the repository at this point in the history
I'm not entirely convinced there is no way for `cherry-pick --abort`
to still fail but I can't think of a test case I could use to replace
this.
Due to newly added logic in `abort_cherry_pick()`, aborting is simply
skipped if there is no CHERRY_PICK_HEAD which is why in this case
it no longer fails.
  • Loading branch information
Jackenmen committed Aug 14, 2022
1 parent 79a95a8 commit 9873e90
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions cherry_picker/test_cherry_picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,18 +983,6 @@ def test_abort_cherry_pick_invalid_state(tmp_git_repo_dir):
cherry_picker.abort_cherry_pick()


def test_abort_cherry_pick_fail(tmp_git_repo_dir):
set_state(WORKFLOW_STATES.BACKPORT_PAUSED)

with mock.patch("cherry_picker.cherry_picker.validate_sha", return_value=True):
cherry_picker = CherryPicker("origin", "xxx", [])

with mock.patch("cherry_picker.cherry_picker.wipe_cfg_vals_from_git_cfg"):
cherry_picker.abort_cherry_pick()

assert get_state() == WORKFLOW_STATES.ABORTING_FAILED


def test_abort_cherry_pick_success(
tmp_git_repo_dir, git_branch, git_add, git_commit, git_checkout, git_cherry_pick
):
Expand Down

0 comments on commit 9873e90

Please sign in to comment.