| 1 |
"""Test octocat.""" |
| 2 |
# pylint: disable=missing-docstring |
| 3 |
from aiohttp.hdrs import CONTENT_TYPE |
| 4 |
import pytest |
| 5 |
|
| 6 |
from aiogithubapi import GitHubAPI |
| 7 |
from aiogithubapi.const import HttpContentType |
| 8 |
|
| 9 |
from tests.common import MockedRequests, MockResponse |
| 10 |
|
| 11 |
|
| 12 |
@pytest.mark.asyncio |
| 13 |
async def test_octocat( |
| 14 |
github_api: GitHubAPI, |
| 15 |
mock_response: MockResponse, |
| 16 |
mock_requests: MockedRequests, |
| 17 |
): |
| 18 |
mock_response.mock_headers = {CONTENT_TYPE: HttpContentType.TEXT_PLAIN} |
| 19 |
response = await github_api.octocat() |
| 20 |
assert response.status == 200 |
| 21 |
assert "Encourage flow." in response.data |
| 22 |
assert mock_requests.called == 1 |
| 23 |
assert mock_requests.last_request["url"] == "https://api.github.com/octocat" |