Skip to content

Commit f6523c1

Browse files
ruudaByron
authored andcommitted
Add regression test for TagReference.create
If you pass the "message" kwarg, it also translates it to an -m command line flag, and with both -m and --message, the message appears twice. I will fix this in the next commit.
1 parent f0c6e11 commit f6523c1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/test_refs.py

+17
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,23 @@ def test_head_reset(self, rw_repo):
572572

573573
# END for each path
574574

575+
@with_rw_repo("0.1.6")
576+
def test_tag_message(self, rw_repo):
577+
tag_ref = TagReference.create(rw_repo, "test-message-1", message="test")
578+
assert tag_ref.tag.message == "test"
579+
580+
tag_ref = TagReference.create(rw_repo, "test-message-2", logmsg="test")
581+
assert tag_ref.tag.message == "test"
582+
583+
tag_ref = TagReference.create(
584+
rw_repo,
585+
"test-message-3",
586+
# Logmsg should take precedence over "message".
587+
message="test1",
588+
logmsg="test2",
589+
)
590+
assert tag_ref.tag.message == "test2"
591+
575592
def test_dereference_recursive(self):
576593
# for now, just test the HEAD
577594
assert SymbolicReference.dereference_recursive(self.rorepo, "HEAD")

0 commit comments

Comments
 (0)