Skip to content

Commit 36f0732

Browse files
committed
mock the validate_sha
1 parent 1c816d0 commit 36f0732

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cherry_picker/cherry_picker/test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ def test_get_author_info_from_short_sha(subprocess_check_output):
176176
],
177177
)
178178
@mock.patch("os.path.exists")
179+
@mock.patch("cherry_picker.cherry_picker.validate_sha")
179180
def test_sorted_branch(os_path_exists, config, input_branches, sorted_branches):
180181
os_path_exists.return_value = True
181182
cp = CherryPicker(
@@ -384,7 +385,6 @@ def test_load_config_no_head_sha(tmp_git_repo_dir, git_add, git_commit):
384385
)
385386
git_add(relative_config_path)
386387
git_commit(f"Add {relative_config_path}")
387-
scm_revision = get_sha1_from("HEAD")
388388

389389
with mock.patch("cherry_picker.cherry_picker.get_sha1_from", return_value=""):
390390
cfg = load_config(relative_config_path)
@@ -463,7 +463,7 @@ def test_from_git_rev_read_uncommitted(tmp_git_repo_dir, git_add, git_commit):
463463
)
464464
git_add(".")
465465
with pytest.raises(ValueError):
466-
from_git_rev_read("HEAD:" + relative_file_path) == some_text
466+
from_git_rev_read("HEAD:" + relative_file_path)
467467

468468

469469
def test_from_git_rev_read(tmp_git_repo_dir, git_add, git_commit):

0 commit comments

Comments
 (0)