-
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.
- Loading branch information
1 parent
f60b266
commit ffae2fb
Showing
1 changed file
with
32 additions
and
0 deletions.
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 |
---|---|---|
|
@@ -30,6 +30,38 @@ | |
|
||
|
||
class GitHubReleaseTestCase(unittest.TestCase): | ||
@patch("pontos.github.api.api.httpx.post") | ||
def test_create_tag(self, requests_mock: MagicMock): | ||
api = GitHubRESTApi("12345") | ||
api.create_tag( | ||
owner="foo", | ||
repo="bar", | ||
tag="v1.2.3", | ||
message="test tag", | ||
git_object="sha", | ||
name="Test user", | ||
email="[email protected]", | ||
date="2022-10-18T04:40:22.157178", | ||
) | ||
|
||
args, kwargs = default_request( | ||
"https://api.github.com/repos/foo/bar/git/tags", | ||
json={ | ||
"owner": "foo", | ||
"repo": "bar", | ||
"tag": "v1.2.3", | ||
"message": "test tag", | ||
"object": "sha", | ||
"type": "commit", | ||
"tagger": { | ||
"name": "Test user", | ||
"email": "[email protected]", | ||
"date": "2022-10-18T04:40:22.157178", | ||
}, | ||
}, | ||
) | ||
requests_mock.assert_called_once_with(*args, **kwargs) | ||
|
||
@patch("pontos.github.api.api.httpx.post") | ||
def test_create_release(self, requests_mock: MagicMock): | ||
api = GitHubRESTApi("12345") | ||
|