Debian Codegraph @

tests/github/test_versions.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_versions(
14 github_api: GitHubAPI,
15 mock_response: MockResponse,
16 mock_requests: MockedRequests,
17 ):
18 response = await github_api.versions()
19 assert response.status == 200
20 assert response.data[0] == "2022-11-28"
21 assert response.headers.x_github_api_version_selected == "2022-11-28"
22 assert mock_requests.called == 1
23 assert mock_requests.last_request["url"] == "https://api.github.com/versions"