-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: refactor github methods out of contributor mod
Fix: refactor github methods out of contributor mod
- Loading branch information
Showing
9 changed files
with
157 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from pyosmeta.contributors import ProcessContributors | ||
from pyosmeta.github_api import GitHubAPI | ||
|
||
|
||
def test_init(mocker): | ||
"""Test that the ProcessContributors object instantiates as | ||
expected""" | ||
|
||
# Create a mock GitHubAPI object | ||
github_api_mock = mocker.MagicMock(spec=GitHubAPI) | ||
json_files = ["file1.json", "file2.json"] | ||
|
||
process_contributors = ProcessContributors(github_api_mock, json_files) | ||
|
||
assert process_contributors.github_api == github_api_mock | ||
assert process_contributors.json_files == json_files | ||
|
||
|
||
def test_return_user_info(mock_github_api, ghuser_response): | ||
"""Test that return from github API user info returns expected | ||
GH username.""" | ||
|
||
process_contributors = ProcessContributors(mock_github_api, []) | ||
gh_handle = "chayadecacao" | ||
user_info = process_contributors.return_user_info(gh_handle) | ||
|
||
assert user_info["github_username"] == gh_handle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters