Skip to content

Commit

Permalink
Add: unittest test_create_tag_reference
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalholthaus authored and bjoernricks committed Oct 19, 2022
1 parent ffae2fb commit 5672f04
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/github/api/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,27 @@


class GitHubReleaseTestCase(unittest.TestCase):
@patch("pontos.github.api.api.httpx.post")
def test_create_tag_reference(self, requests_mock: MagicMock):
api = GitHubRESTApi("12345")
api.create_tag_reference(
owner="foo",
repo="bar",
tag="v1.2.3",
sha="sha",
)

args, kwargs = default_request(
"https://api.github.com/repos/foo/bar/git/refs",
json={
"owner": "foo",
"repo": "bar",
"ref": "refs/tags/v1.2.3",
"sha": "sha",
},
)
requests_mock.assert_called_once_with(*args, **kwargs)

@patch("pontos.github.api.api.httpx.post")
def test_create_tag(self, requests_mock: MagicMock):
api = GitHubRESTApi("12345")
Expand Down

0 comments on commit 5672f04

Please sign in to comment.