Skip to content

Commit

Permalink
fix(get-next-bump): add a test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Lowaiz committed Nov 29, 2024
1 parent 9971a32 commit d563504
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/commands/test_bump_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,24 @@ def test_bump_get_next(mocker: MockFixture, capsys):
tag_exists = git.tag_exist("0.2.0")
assert tag_exists is False

@pytest.mark.usefixtures("tmp_commitizen_project")
def test_bump_get_next_update_changelog_on_bump(mocker: MockFixture, capsys, config_path):
create_file_and_commit("feat: new file")
with open(config_path, "a", encoding="utf-8") as fp:
fp.write("update_changelog_on_bump = true\n")

testargs = ["cz", "bump", "--yes", "--get-next"]
mocker.patch.object(sys, "argv", testargs)
with pytest.raises(GetNextExit):
cli.main()

out, _ = capsys.readouterr()
assert "0.2.0" in out

tag_exists = git.tag_exist("0.2.0")
assert tag_exists is False



@pytest.mark.usefixtures("tmp_commitizen_project")
def test_bump_get_next__changelog_is_not_allowed(mocker: MockFixture):
Expand Down

0 comments on commit d563504

Please sign in to comment.