-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: unittest for create_tag cmd function
- Loading branch information
1 parent
86ffe7f
commit f60b266
Showing
1 changed file
with
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ | |
from unittest.mock import MagicMock, patch | ||
|
||
from pontos.github.api import FileStatus | ||
from pontos.github.cmds import file_status, create_release | ||
from pontos.github.cmds import file_status, create_release, create_tag | ||
|
||
here = Path(__file__).parent | ||
|
||
|
@@ -108,3 +108,26 @@ def test_create_release(self, api_mock): | |
) | ||
|
||
create_release(terminal, args) | ||
|
||
@patch("pontos.github.cmds.GitHubRESTApi") | ||
def test_create_tag(self, api_mock): | ||
terminal = MagicMock() | ||
api_mock.return_value.create_tag_reference.return_value = True | ||
api_mock.return_value.create_tag.return_value = True | ||
|
||
args = Namespace( | ||
command="TAG", | ||
func=create_tag, | ||
owner="test user", | ||
repo="foo/bar", | ||
tag="test_tag", | ||
name="test_release", | ||
message="test msg", | ||
git_object="commit-sha", | ||
git_object_type=None, | ||
email="[email protected]", | ||
date=None, | ||
token="GITHUB_TOKEN", | ||
) | ||
|
||
create_tag(terminal, args) |