Skip to content

Commit 3759a2d

Browse files
committed
✅ Add cherry-pick fail test
1 parent 6a903ae commit 3759a2d

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

cherry_picker/cherry_picker/test.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from .cherry_picker import get_base_branch, get_current_branch, \
1010
get_full_sha_from_short, get_author_info_from_short_sha, \
11-
CherryPicker, InvalidRepoException, \
11+
CherryPicker, InvalidRepoException, CherryPickException, \
1212
normalize_commit_message, DEFAULT_CONFIG, \
1313
get_sha1_from, find_config, load_config, validate_sha, \
1414
from_git_rev_read, \
@@ -530,3 +530,16 @@ def test_cleanup_branch_fail(tmp_git_repo_dir):
530530

531531
cherry_picker.cleanup_branch('some_branch')
532532
assert get_state() == 'REMOVING_BACKPORT_BRANCH_FAILED'
533+
534+
535+
def test_cherry_pick_fail(
536+
tmp_git_repo_dir,
537+
):
538+
with mock.patch(
539+
'cherry_picker.cherry_picker.validate_sha',
540+
return_value=True,
541+
):
542+
cherry_picker = CherryPicker('origin', 'xxx', [])
543+
544+
with pytest.raises(CherryPickException, message='Error cherry-pick xxx.'):
545+
cherry_picker.cherry_pick()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy