Skip to content

Commit

Permalink
Another small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lwasser committed Mar 12, 2024
1 parent f384d1a commit 555ea14
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
from pyosmeta.parse_issues import ProcessIssues


@pytest.fixture
def github_api():
return GitHubAPI(
org="pyopensci", repo="pyosmeta", labels=["label1", "label2"]
)


@pytest.fixture
def process_issues():
"""A fixture that returns an instance of the ProcessIssues class"""
Expand Down
11 changes: 11 additions & 0 deletions tests/unit/test_github_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,14 @@ def test_missing_token(mock_missing_github_token, tmpdir):

with pytest.raises(KeyError, match="Oops! A GITHUB_TOKEN environment"):
github_api.get_token()


def test_api_endpoint(github_api):
"""Test that the generated api url created in the property
is as expected
"""
expected_endpoint = (
"https://api.github.com/repos/pyopensci/pyosmeta/"
"issues?labels=label1,label2&state=all&per_page=100"
)
assert github_api.api_endpoint == expected_endpoint

0 comments on commit 555ea14

Please sign in to comment.