Skip to content

Commit

Permalink
Add: Unittest create_tag
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalholthaus authored and bjoernricks committed Oct 19, 2022
1 parent f60b266 commit ffae2fb
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/github/api/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit ffae2fb

Please sign in to comment.