# Path: api/github/process.py
# class RepoProcessor:
#     def __init__(self, client: GitHubClient):
#     async def get_comparison_since_last_release(self, username: str, repo: str):
# 
# Path: api/tests/conftest.py
# @decorator
# def async_test(func, *args, **kwargs):
#     future = func(*args, **kwargs)
#     asyncio.get_event_loop().run_until_complete(future)
# 
# class BaseMockGitHubClient(GitHubClient):
# 
#     # Stub out request method
#     async def make_request(self, **kwargs):
#         pass
# 
#     async def repo_tags(self, username, repo):
#         raise NotImplementedError
# 
#     async def user_repos(self, username, sort='pushed'):
#         raise NotImplementedError
# 
#     async def compare(self, username: str, repo: str, base: str, head='HEAD'):
#         raise NotImplementedError
# 
#     async def rate_limit(self):
#         raise NotImplementedError


import json
import os
import pytest
from api.github import process
from api.tests.conftest import async_test, BaseMockGitHubClient



HERE = os.path.dirname(os.path.abspath(__file__))

class MockGitHubClient(BaseMockGitHubClient):

    def _response_from_file(self, json_file):
        with open(os.path.join(HERE, 'responses', json_file)) as fp:
            ret = json.load(fp)
        return ret

    async def repo_tags(self, *args, **kwargs):
        return self._response_from_file('repo_tags.json')

    async def user_repos(self, *args, **kwargs):
        return self._response_from_file('user_repos.json')


# Path: api/github/process.py
# class RepoProcessor:
#     def __init__(self, client: GitHubClient):
#     async def get_comparison_since_last_release(self, username: str, repo: str):
# 
# Path: api/tests/conftest.py
# @decorator
# def async_test(func, *args, **kwargs):
#     future = func(*args, **kwargs)
#     asyncio.get_event_loop().run_until_complete(future)
# 
# class BaseMockGitHubClient(GitHubClient):
# 
#     # Stub out request method
#     async def make_request(self, **kwargs):
#         pass
# 
#     async def repo_tags(self, username, repo):
#         raise NotImplementedError
# 
#     async def user_repos(self, username, sort='pushed'):
#         raise NotImplementedError
# 
#     async def compare(self, username: str, repo: str, base: str, head='HEAD'):
#         raise NotImplementedError
# 
#     async def rate_limit(self):
#         raise NotImplementedError


# Path: api/tests/test_github/test_process.py
import json
import os
import pytest
from api.github import process
from api.tests.conftest import async_test, BaseMockGitHubClient




HERE = os.path.dirname(os.path.abspath(__file__))

class MockGitHubClient(BaseMockGitHubClient):

    def _response_from_file(self, json_file):
        with open(os.path.join(HERE, 'responses', json_file)) as fp:
            ret = json.load(fp)
        return ret

    async def repo_tags(self, *args, **kwargs):
        return self._response_from_file('repo_tags.json')

    async def user_repos(self, *args, **kwargs):
        return self._response_from_file('user_repos.json')


    async def compare(self, *args, **kwargs):