File: test_usersearch.py

package info (click to toggle)
python-xbox-webapi 2.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,916 kB
  • sloc: python: 4,973; makefile: 79
file content (16 lines) | stat: -rw-r--r-- 443 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from httpx import Response
import pytest

from tests.common import get_response_json


@pytest.mark.asyncio
async def test_profile_by_xuid(respx_mock, xbl_client):
    route = respx_mock.get("https://usersearch.xboxlive.com").mock(
        return_value=Response(200, json=get_response_json("usersearch_live_search"))
    )
    ret = await xbl_client.usersearch.get_live_search("tux")

    assert len(ret.results) == 8

    assert route.called