Skip to content

Commit

Permalink
Update tests to check for base branches which have dashes in them.
Browse files Browse the repository at this point in the history
  • Loading branch information
abadger committed Jun 16, 2018
1 parent c5f7faf commit 04e31d5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cherry_picker/cherry_picker/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ def changedir(d):


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


def test_get_base_branch_without_dash():
cherry_pick_branch ='master'
def test_get_base_branch_which_has_dashes():
cherry_pick_branch ='backport-afc23f4-baseprefix-2.7-basesuffix'
result = get_base_branch(cherry_pick_branch)
assert result == 'master'
assert result == 'prefix-2.7-suffix'


@mock.patch('subprocess.check_output')
Expand Down

0 comments on commit 04e31d5

Please sign in to comment.