Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Riedel committed Jul 12, 2022
1 parent 99c74dd commit 64eb8e5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
4 changes: 3 additions & 1 deletion tests/test_add_jira_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,6 @@ class MockBranch: # pylint: disable=too-few-public-methods, missing-class-docst
mock_commit_msg_file.write_text("commit message 0815\n#TEST-123")
result = cli_runner.invoke(main, ["--jira-tag=TEST", str(mock_commit_msg_file)])
assert result.exit_code == 0
assert mock_commit_msg_file.read_text() == "TEST-123: commit message 0815\n#TEST-123"
assert (
mock_commit_msg_file.read_text() == "TEST-123: commit message 0815\n#TEST-123"
)
25 changes: 23 additions & 2 deletions tests/test_check_jira_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,18 @@ def test_empty_commit_msg_but_comments(mock_ini, mock_commit_msg_file, cli_runne
assert "Commit message is empty." in result.output


@pytest.mark.parametrize("commit_msg", ["message", "message tag", "message tag-", "message #tag", "message #tag-123", "tag message", "tag- message"])
@pytest.mark.parametrize(
"commit_msg",
[
"message",
"message tag",
"message tag-",
"message #tag",
"message #tag-123",
"tag message",
"tag- message",
],
)
def test_missing_tag(commit_msg, mock_ini, mock_commit_msg_file, cli_runner):
"""Assert error on missing tag."""
mock_commit_msg_file.write_text(commit_msg)
Expand All @@ -128,7 +139,17 @@ def test_missing_tag(commit_msg, mock_ini, mock_commit_msg_file, cli_runner):
assert "'TAG' tag not found" in result.output


@pytest.mark.parametrize("commit_msg", ["message TAG", "message TAG-", "message #TAG", "message #TAG-", "TAG message", "TAG- message"])
@pytest.mark.parametrize(
"commit_msg",
[
"message TAG",
"message TAG-",
"message #TAG",
"message #TAG-",
"TAG message",
"TAG- message",
],
)
def test_missing_tag_number(commit_msg, mock_ini, mock_commit_msg_file, cli_runner):
"""Assert error on missing tag number."""
mock_commit_msg_file.write_text(commit_msg)
Expand Down

0 comments on commit 64eb8e5

Please sign in to comment.