# Path: api/github/client.py
# class GitHubClientError(Exception):
#     def __init__(self, body, response):
#         self.body = body
#         self.response = response
# 
# Path: api/tests/conftest.py
# 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


from unittest import mock
from webtest_aiohttp import TestApp
from api.github.client import GitHubClientError
from api.tests.conftest import BaseMockGitHubClient
import pytest



class MockGitHubClient(BaseMockGitHubClient):

    async def repo_tags(self, *args, **kwargs):
        return [
            {'name': '1.2.3', 'commit': {'sha': '123abc'}},
            {'name': '1.2.2', 'commit': {'sha': 'abc123'}},
        ]

    async def compare(self, *args, **kwargs):
        return {
            'ahead_by': 42,
            'base_commit': {'sha': '123abc'}
        }


# Path: api/github/client.py
# class GitHubClientError(Exception):
#     def __init__(self, body, response):
#         self.body = body
#         self.response = response
# 
# Path: api/tests/conftest.py
# 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_handlers.py
from unittest import mock
from webtest_aiohttp import TestApp
from api.github.client import GitHubClientError
from api.tests.conftest import BaseMockGitHubClient
import pytest




class MockGitHubClient(BaseMockGitHubClient):

    async def repo_tags(self, *args, **kwargs):
        return [
            {'name': '1.2.3', 'commit': {'sha': '123abc'}},
            {'name': '1.2.2', 'commit': {'sha': 'abc123'}},
        ]

    async def compare(self, *args, **kwargs):
        return {
            'ahead_by': 42,
            'base_commit': {'sha': '123abc'}
        }


class MockGitHubErrorClient(BaseMockGitHubClient):