Skip to content

Commit

Permalink
Alter invalid branch test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen committed Jul 10, 2022
1 parent 72b10ef commit 7649ec4
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions cherry_picker/test_cherry_picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def test_get_base_branch_which_has_dashes(subprocess_check_output):
[
"backport-22a594a", # Not enough fields
"prefix-22a594a-2.7", # Not the prefix we were expecting
"backport-22a594a-base", # No version info in the base branch
"backport-22a594a-", # No base branch
],
)
@mock.patch("subprocess.check_output")
Expand Down Expand Up @@ -201,20 +201,13 @@ def test_sorted_branch(os_path_exists, config, input_branches, sorted_branches):
assert cp.sorted_branches == sorted_branches


@pytest.mark.parametrize(
"input_branches",
[
(["3.1", "2.7", "3.x10", "3.6", ""]),
(["stable-3.1", "lts-2.7", "3.10-other", "smth3.6else", "invalid"]),
],
)
@mock.patch("os.path.exists")
def test_invalid_branches(os_path_exists, config, input_branches):
def test_invalid_branch_empty_string(os_path_exists, config):
os_path_exists.return_value = True
cp = CherryPicker(
"origin",
"22a594a0047d7706537ff2ac676cdc0f1dcb329c",
input_branches,
["3.1", "2.7", "3.10", "3.6", ""],
config=config,
)
with pytest.raises(ValueError):
Expand Down

0 comments on commit 7649ec4

Please sign in to comment.