| 1 |
"""Test rate_limit.""" |
| 2 |
# pylint: disable=missing-docstring |
| 3 |
import pytest |
| 4 |
|
| 5 |
from aiogithubapi import GitHubAPI |
| 6 |
|
| 7 |
from tests.common import MockedRequests |
| 8 |
|
| 9 |
|
| 10 |
@pytest.mark.asyncio |
| 11 |
async def test_rate_limit(github_api: GitHubAPI, mock_requests: MockedRequests): |
| 12 |
response = await github_api.rate_limit() |
| 13 |
assert response.status == 200 |
| 14 |
assert response.data.resources.core.limit == 5000 |
| 15 |
assert mock_requests.called == 1 |
| 16 |
assert mock_requests.last_request["url"] == "https://api.github.com/rate_limit" |