chore: update to latest pytest (#2800)

This commit is contained in:
dni ⚡ 2024-12-11 10:39:28 +01:00 committed by GitHub
parent 8ff4962e86
commit 291c69e470
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 303 additions and 310 deletions

View file

@ -1,21 +1,21 @@
import pytest
@pytest.mark.asyncio
@pytest.mark.anyio
async def test_core_views_generic(client):
response = await client.get("/")
assert response.status_code == 200, f"{response.url} {response.status_code}"
# check GET /wallet: wrong user, expect 400
@pytest.mark.asyncio
@pytest.mark.anyio
async def test_get_wallet_with_nonexistent_user(client):
response = await client.get("wallet", params={"usr": "1"})
assert response.status_code == 400, f"{response.url} {response.status_code}"
# check GET /wallet: wallet and user
@pytest.mark.asyncio
@pytest.mark.anyio
async def test_get_wallet_with_user_and_wallet(client, to_user, to_wallet):
response = await client.get(
"wallet", params={"usr": to_user.id, "wal": to_wallet.id}
@ -24,28 +24,28 @@ async def test_get_wallet_with_user_and_wallet(client, to_user, to_wallet):
# check GET /wallet: wrong wallet and user, expect 400
@pytest.mark.asyncio
@pytest.mark.anyio
async def test_get_wallet_with_user_and_wrong_wallet(client, to_user):
response = await client.get("wallet", params={"usr": to_user.id, "wal": "1"})
assert response.status_code == 400, f"{response.url} {response.status_code}"
# check GET /extensions: extensions list
@pytest.mark.asyncio
@pytest.mark.anyio
async def test_get_extensions(client, to_user):
response = await client.get("extensions", params={"usr": to_user.id})
assert response.status_code == 200, f"{response.url} {response.status_code}"
# check GET /extensions: extensions list wrong user, expect 400
@pytest.mark.asyncio
@pytest.mark.anyio
async def test_get_extensions_wrong_user(client):
response = await client.get("extensions", params={"usr": "1"})
assert response.status_code == 400, f"{response.url} {response.status_code}"
# check GET /extensions: no user given, expect code 400 bad request
@pytest.mark.asyncio
@pytest.mark.anyio
async def test_get_extensions_no_user(client):
response = await client.get("extensions")
# bad request