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

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Parametrize test for custom named branches
  • Loading branch information
webknjaz committed Jun 9, 2018
commit 115d6165bbc2f43878f764afb47d85d217736402
11 changes: 7 additions & 4 deletions cherry_picker/cherry_picker/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,16 @@ def test_get_author_info_from_short_sha(subprocess_check_output):
assert get_author_info_from_short_sha('22a594a') == 'Armin Rigo <[email protected]>'


@pytest.mark.parametrize('input_branches,sorted_branches', [
(['3.1', '2.7', '3.10', '3.6'], ['3.10', '3.6', '3.1', '2.7']),
(['stable-3.1', 'lts-2.7', '3.10-other', 'smth3.6else'], ['3.10-other', 'smth3.6else', 'stable-3.1', 'lts-2.7']),
])
@mock.patch('os.path.exists')
def test_sorted_branch(os_path_exists, config):
def test_sorted_branch(os_path_exists, config, input_branches, sorted_branches):
os_path_exists.return_value = True
branches = ["3.1", "2.7", "3.10", "3.6"]
cp = CherryPicker('origin', '22a594a0047d7706537ff2ac676cdc0f1dcb329c',
branches, config=config)
assert cp.sorted_branches == ["3.10", "3.6", "3.1", "2.7"]
input_branches, config=config)
assert cp.sorted_branches == sorted_branches


@mock.patch('os.path.exists')
Expand Down