Debian Codegraph @

tests/github/test_zen.py

raw
1 """Test zen."""
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_zen(
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.zen()
20 assert response.status == 200
21 assert response.data == "Beautiful is better than ugly."
22 assert mock_requests.called == 1
23 assert mock_requests.last_request["url"] == "https://api.github.com/zen"