Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions commitizen/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
"name": ["--increment"],
"help": "manually specify the desired increment",
"choices": ["MAJOR", "MINOR", "PATCH"],
"type": str.upper,
},
{
"name": ["--check-consistency", "-cc"],
Expand Down
21 changes: 21 additions & 0 deletions tests/commands/test_bump_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,27 @@ def test_bump_major_increment(commit_msg, mocker):
assert tag_exists is True


@pytest.mark.usefixtures("tmp_commitizen_project")
@pytest.mark.parametrize(
"commit_msg,increment,expected_tag",
[
("feat: new file", "PATCH", "0.1.1"),
("fix: username exception", "major", "1.0.0"),
("refactor: remove ini configuration support", "patch", "0.1.1"),
("BREAKING CHANGE: age is no longer supported", "minor", "0.2.0"),
],
)
def test_bump_command_increment_option(commit_msg, increment, expected_tag, mocker):
create_file_and_commit(commit_msg)

testargs = ["cz", "bump", "--increment", increment, "--yes"]
mocker.patch.object(sys, "argv", testargs)
cli.main()

tag_exists = git.tag_exist(expected_tag)
assert tag_exists is True


@pytest.mark.usefixtures("tmp_commitizen_project")
def test_bump_command_prelease(mocker):
# PRERELEASE
Expand Down