-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b410d01
commit d3e3ad8
Showing
2 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"""Test changelog parses Jira issues properly""" | ||
|
||
from rhenvision_changelog.changelog import ProvisioningChangelog | ||
from rhenvision_changelog.commit_check import check_commit | ||
|
||
jira_project = "HMS" | ||
commit_head = """a5bc1e0f00aed28102579d14d651a27d5dded4a4 | ||
John Doe | ||
jdoe@test.com | ||
1669736056 | ||
John Doe | ||
jdoe@test.com | ||
1669736056 | ||
HEAD -> branch, origin/branch | ||
""" | ||
|
||
class StubbedChangelog(ProvisioningChangelog): | ||
def __init__(self, commit_message): | ||
self.commit_message = commit_message | ||
super().__init__('.', 'https://jira.test.com', jira_project) | ||
|
||
def get_log(self) -> str: | ||
"""Get stubbed `git log` output defined by stub passed to constructor. | ||
Returns: | ||
The stubbed `git log` in a particular format. | ||
""" | ||
return commit_head + self.commit_message + "\n\n"+self.MARKER+"\n" | ||
|
||
def get_remote_url(self) -> str: | ||
return "https://github.com/RHEnVision/provisioning" | ||
|
||
|
||
|
||
def test_jira_issue_parsing() -> int: | ||
changelog = StubbedChangelog("feat(HMS-123): Subject") | ||
assert changelog.commits[0].convention["scope"] == "[HMS-123](https://jira.test.com/browse/HMS-123)" |