forked from sr2/cloud-api
minor: rename test client
client -> default_client To allow for different clients. Primarily to allow different overrides for auth testing.
This commit is contained in:
parent
a907506ec1
commit
9d9ca0b907
7 changed files with 140 additions and 140 deletions
|
|
@ -6,11 +6,11 @@
|
|||
import pytest
|
||||
from httpx import AsyncClient
|
||||
|
||||
from .conftest import client
|
||||
from .conftest import default_client
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_get_self_db(client: AsyncClient):
|
||||
resp = await client.get("/user/self/db")
|
||||
async def test_get_self_db(default_client: AsyncClient):
|
||||
resp = await default_client.get("/user/self/db")
|
||||
data = resp.json()
|
||||
|
||||
assert resp.status_code == 200
|
||||
|
|
@ -22,8 +22,8 @@ async def test_get_self_db(client: AsyncClient):
|
|||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_get_user_success(client: AsyncClient):
|
||||
resp = await client.get("/user/?user_id=1")
|
||||
async def test_get_user_success(default_client: AsyncClient):
|
||||
resp = await default_client.get("/user/?user_id=1")
|
||||
data = resp.json()
|
||||
|
||||
assert resp.status_code == 200
|
||||
|
|
@ -44,7 +44,7 @@ async def test_get_user_success(client: AsyncClient):
|
|||
("", 422),
|
||||
],
|
||||
)
|
||||
async def test_get_user_fail(client: AsyncClient, query: str, expected_status: int):
|
||||
resp = await client.get(f"/user/?{query}")
|
||||
async def test_get_user_fail(default_client: AsyncClient, query: str, expected_status: int):
|
||||
resp = await default_client.get(f"/user/?{query}")
|
||||
|
||||
assert resp.status_code == expected_status
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue