| 1 |
"""Test git namespace.""" |
| 2 |
# pylint: disable=missing-docstring |
| 3 |
import pytest |
| 4 |
|
| 5 |
from aiogithubapi import GitHubAPI |
| 6 |
|
| 7 |
from tests.common import TEST_REPOSITORY_NAME, MockedRequests |
| 8 |
|
| 9 |
|
| 10 |
@pytest.mark.asyncio |
| 11 |
async def test_get_tree(github_api: GitHubAPI, mock_requests: MockedRequests): |
| 12 |
response = await github_api.repos.git.get_tree(TEST_REPOSITORY_NAME, "master") |
| 13 |
assert response.status == 200 |
| 14 |
assert response.data.tree[0].path == "README" |
| 15 |
assert mock_requests.called == 1 |
| 16 |
assert ( |
| 17 |
mock_requests.last_request["url"] |
| 18 |
== "https://api.github.com/repos/octocat/hello-world/git/trees/master" |
| 19 |
) |