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.
21 lines
706 B
Python
21 lines
706 B
Python
import pytest
|
|
from httpx import AsyncClient
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_get_plant_masterdatas(client: AsyncClient):
|
|
response = await client.get("/plant-masterdata")
|
|
assert response.status_code == 200
|
|
assert response.json()["message"] == "Data retrieved successfully"
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_create_plant_masterdata(client: AsyncClient):
|
|
payload = {
|
|
"name": "Plant Parameter",
|
|
"description": "Plant Desc",
|
|
"unit_of_measurement": "unit",
|
|
"value_num": 10.5
|
|
}
|
|
response = await client.post("/plant-masterdata", json=payload)
|
|
assert response.status_code == 200
|
|
assert response.json()["message"] == "Data created successfully"
|