mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-08-26 16:40:40 +03:00
fix tests
This commit is contained in:
parent
89595175e6
commit
4d947c5826
@ -26,7 +26,7 @@ async def test_add_stuff(client: AsyncClient, payload: dict, status_code: int):
|
|||||||
"payload, status_code",
|
"payload, status_code",
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
{"name": "motorhead", "description": "we play rock and roll"},
|
{"name": "motorhead-0", "description": "we play rock and roll"},
|
||||||
status.HTTP_200_OK,
|
status.HTTP_200_OK,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -44,13 +44,14 @@ async def test_get_stuff(client: AsyncClient, payload: dict, status_code: int):
|
|||||||
"payload, status_code",
|
"payload, status_code",
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
{"name": "motorhead", "description": "we play rock and roll"},
|
{"name": "motorhead-1", "description": "we play rock and roll"},
|
||||||
status.HTTP_200_OK,
|
status.HTTP_200_OK,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
async def test_delete_stuff(client: AsyncClient, payload: dict, status_code: int):
|
async def test_delete_stuff(client: AsyncClient, payload: dict, status_code: int):
|
||||||
response = await client.post("/stuff", json=payload)
|
response = await client.post("/stuff", json=payload)
|
||||||
|
print(response.json())
|
||||||
name = response.json()["name"]
|
name = response.json()["name"]
|
||||||
response = await client.delete(f"/stuff/{name}")
|
response = await client.delete(f"/stuff/{name}")
|
||||||
assert response.status_code == status_code
|
assert response.status_code == status_code
|
||||||
|
Loading…
x
Reference in New Issue
Block a user