Skip to content

Commit

Permalink
add: tests for both endpoint types and label values
Browse files Browse the repository at this point in the history
  • Loading branch information
lwasser committed Aug 15, 2024
1 parent 631eeeb commit f7ff907
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## [Unreleased]

* Add: Endpoint variable to support both prs and issues to GitHubAPI (@lwasser)

## [v0.3.4] - 2024-08-01

### Fixes
Expand Down
21 changes: 21 additions & 0 deletions tests/unit/test_github_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,27 @@ def test_missing_token(mock_missing_github_token, tmpdir):
["label1", "label2"],
"https://api.github.com/repos/pyopensci/pyosmeta/issues?state=all&per_page=100",
),
(
"pyopensci",
"pyosmeta",
"pulls",
[],
"https://api.github.com/repos/pyopensci/pyosmeta/pulls?state=all&per_page=100",
),
(
"pyopensci",
"pyosmeta",
"pulls",
["label1"],
"https://api.github.com/repos/pyopensci/pyosmeta/pulls?labels=label1&state=all&per_page=100",
),
(
"pyopensci",
"pyosmeta",
"pulls",
["label1", "label2"],
"https://api.github.com/repos/pyopensci/pyosmeta/pulls?state=all&per_page=100",
),
],
)
def test_api_endpoint(org, repo, endpoint_type, labels, expected_url):
Expand Down

0 comments on commit f7ff907

Please sign in to comment.