From 9873e90d9e5e784429979ec3423d5b3edead1ecc Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Sun, 8 Aug 2021 02:27:12 +0200 Subject: [PATCH] Remove test_abort_cherry_pick_fail 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. --- cherry_picker/test_cherry_picker.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/cherry_picker/test_cherry_picker.py b/cherry_picker/test_cherry_picker.py index 46359f9..c2ef1f5 100644 --- a/cherry_picker/test_cherry_picker.py +++ b/cherry_picker/test_cherry_picker.py @@ -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 ):