Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04e31d5

Browse files
committed
Update tests to check for base branches which have dashes in them.
1 parent c5f7faf commit 04e31d5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cherry_picker/cherry_picker/test.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,16 @@ def changedir(d):
3333

3434

3535
def test_get_base_branch():
36+
# The format of cherry-pick branches we create are "backport-{SHA}-{base_branch}"
3637
cherry_pick_branch = 'backport-afc23f4-2.7'
3738
result = get_base_branch(cherry_pick_branch)
3839
assert result == '2.7'
3940

4041

41-
def test_get_base_branch_without_dash():
42-
cherry_pick_branch ='master'
42+
def test_get_base_branch_which_has_dashes():
43+
cherry_pick_branch ='backport-afc23f4-baseprefix-2.7-basesuffix'
4344
result = get_base_branch(cherry_pick_branch)
44-
assert result == 'master'
45+
assert result == 'prefix-2.7-suffix'
4546

4647

4748
@mock.patch('subprocess.check_output')

0 commit comments

Comments
 (0)