Shopify_AI / tests /test_api.py
Prerna43's picture
shopify_ai
80ef840
Raw
History Blame Contribute Delete
461 Bytes
from fastapi.testclient import TestClient
from app.main import app
def test_ticket_endpoint_returns_response():
client = TestClient(app)
response = client.post(
"/api/tickets",
json={"customer_id": "cust_001", "message": "My order #1234 is delayed. Can I get a refund?"},
)
assert response.status_code == 200
payload = response.json()
assert payload["ticket_id"].startswith("ticket_")
assert "response" in payload