Skip to content

Commit e5d6797

Browse files
committed
fix(get-next-bump): add a test case
1 parent 9971a32 commit e5d6797

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Diff for: tests/commands/test_bump_command.py

+20
Original file line numberDiff line numberDiff line change
@@ -1481,6 +1481,26 @@ def test_bump_get_next(mocker: MockFixture, capsys):
14811481
assert tag_exists is False
14821482

14831483

1484+
@pytest.mark.usefixtures("tmp_commitizen_project")
1485+
def test_bump_get_next_update_changelog_on_bump(
1486+
mocker: MockFixture, capsys, config_path
1487+
):
1488+
create_file_and_commit("feat: new file")
1489+
with open(config_path, "a", encoding="utf-8") as fp:
1490+
fp.write("update_changelog_on_bump = true\n")
1491+
1492+
testargs = ["cz", "bump", "--yes", "--get-next"]
1493+
mocker.patch.object(sys, "argv", testargs)
1494+
with pytest.raises(GetNextExit):
1495+
cli.main()
1496+
1497+
out, _ = capsys.readouterr()
1498+
assert "0.2.0" in out
1499+
1500+
tag_exists = git.tag_exist("0.2.0")
1501+
assert tag_exists is False
1502+
1503+
14841504
@pytest.mark.usefixtures("tmp_commitizen_project")
14851505
def test_bump_get_next__changelog_is_not_allowed(mocker: MockFixture):
14861506
create_file_and_commit("feat: new file")

0 commit comments

Comments
 (0)