Skip to content

Commit 5dfdeeb

Browse files
committed
test(commands/changelog): add test case when tag name and the latest tag in changelog are different
1 parent caf42cc commit 5dfdeeb

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/commands/test_changelog_command.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,25 @@ def test_changelog_without_revision(mocker, tmp_commitizen_project):
313313

314314
with pytest.raises(NoRevisionError):
315315
cli.main()
316+
317+
318+
def test_changelog_with_different_tag_name_and_changelog_content(
319+
mocker, tmp_commitizen_project
320+
):
321+
changelog_file = tmp_commitizen_project.join("CHANGELOG.md")
322+
changelog_file.write(
323+
"""
324+
# Unreleased
325+
326+
## v1.0.0
327+
"""
328+
)
329+
create_file_and_commit("feat: new file")
330+
git.tag("2.0.0")
331+
332+
# create_file_and_commit("feat: new file")
333+
testargs = ["cz", "changelog", "--incremental"]
334+
mocker.patch.object(sys, "argv", testargs)
335+
336+
with pytest.raises(NoRevisionError):
337+
cli.main()

0 commit comments

Comments
 (0)