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
test(utils): add test for creating tag with message
  • Loading branch information
LuisHenri authored and Lee-W committed Nov 6, 2023
commit 85684272aad63238751cecb4da5c360d4f40f167
12 changes: 11 additions & 1 deletion tests/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from commitizen import cmd, exceptions, git
from pytest_mock import MockFixture

from tests.utils import FakeCommand, create_file_and_commit
from tests.utils import FakeCommand, create_file_and_commit, create_tag


def test_git_object_eq():
Expand Down Expand Up @@ -239,3 +239,13 @@ def test_eoltypes_get_eol_for_open():
assert git.EOLTypes.get_eol_for_open(git.EOLTypes.NATIVE) == os.linesep
assert git.EOLTypes.get_eol_for_open(git.EOLTypes.LF) == "\n"
assert git.EOLTypes.get_eol_for_open(git.EOLTypes.CRLF) == "\r\n"


def test_create_tag_with_message(tmp_commitizen_project):
with tmp_commitizen_project.as_cwd():
create_file_and_commit("feat(test): test")
tag_name = "1.0"
tag_message = "test message"
create_tag(tag_name, tag_message)
assert git.get_latest_tag_name() == tag_name
assert git.get_tag_message(tag_name) == f"'{tag_message}'"