From f7ff9078f3dcb312902d122279139933fa43c32d Mon Sep 17 00:00:00 2001 From: Leah Wasser Date: Wed, 14 Aug 2024 18:00:56 -0600 Subject: [PATCH] add: tests for both endpoint types and label values --- CHANGELOG.md | 2 ++ tests/unit/test_github_api.py | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b82c54..076ac73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ## [Unreleased] +* Add: Endpoint variable to support both prs and issues to GitHubAPI (@lwasser) + ## [v0.3.4] - 2024-08-01 ### Fixes diff --git a/tests/unit/test_github_api.py b/tests/unit/test_github_api.py index daa2c1d..f3d7b1c 100644 --- a/tests/unit/test_github_api.py +++ b/tests/unit/test_github_api.py @@ -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):