Skip to content

Commit 4df9a7f

Browse files
LuisHenriLee-W
authored andcommitted
test(utils): add test for creating tag with message
1 parent 0fe2b83 commit 4df9a7f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/test_git.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from commitizen import cmd, exceptions, git
99
from pytest_mock import MockFixture
1010

11-
from tests.utils import FakeCommand, create_file_and_commit
11+
from tests.utils import FakeCommand, create_file_and_commit, create_tag
1212

1313

1414
def test_git_object_eq():
@@ -239,3 +239,13 @@ def test_eoltypes_get_eol_for_open():
239239
assert git.EOLTypes.get_eol_for_open(git.EOLTypes.NATIVE) == os.linesep
240240
assert git.EOLTypes.get_eol_for_open(git.EOLTypes.LF) == "\n"
241241
assert git.EOLTypes.get_eol_for_open(git.EOLTypes.CRLF) == "\r\n"
242+
243+
244+
def test_create_tag_with_message(tmp_commitizen_project):
245+
with tmp_commitizen_project.as_cwd():
246+
create_file_and_commit("feat(test): test")
247+
tag_name = "1.0"
248+
tag_message = "test message"
249+
create_tag(tag_name, tag_message)
250+
assert git.get_latest_tag_name() == tag_name
251+
assert git.get_tag_message(tag_name) == f"'{tag_message}'"

0 commit comments

Comments
 (0)