You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
be-lcca/tests/e2e/test_yeardata.py

19 lines
599 B
Python

import pytest
from httpx import AsyncClient
@pytest.mark.asyncio
async def test_get_yeardatas(client: AsyncClient):
response = await client.get("/yeardata")
assert response.status_code == 200
assert response.json()["message"] == "Data retrieved successfully"
@pytest.mark.asyncio
async def test_create_yeardata(client: AsyncClient):
payload = {
"year": 2024,
"description": "Test Year Data"
}
response = await client.post("/yeardata", json=payload)
assert response.status_code == 200
assert response.json()["message"] == "Data created successfully"