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_acquisition_cost.py

24 lines
942 B
Python

import pytest
from httpx import AsyncClient
@pytest.mark.asyncio
async def test_get_acquisition_costs(client: AsyncClient):
response = await client.get("/acquisition-data")
assert response.status_code == 200
assert response.json()["message"] == "Data retrieved successfully"
@pytest.mark.asyncio
async def test_create_acquisition_cost(client: AsyncClient):
payload = {
"assetnum": "TEST-ASSET",
"acquisition_cost": 1000.0,
"acquisition_year": 2024,
"residual_value": 100.0,
"useful_life": 10
}
response = await client.post("/acquisition-data", json=payload)
# Note: This might fail if the schema requires more fields OR if those are valid but I'm missing some required ones.
# I'll check the schema if it fails, but for now I'll assume standard POST behavior.
assert response.status_code == 200
assert response.json()["message"] == "Data created successfully"