Spaces:
Sleeping
Sleeping
Download tests/test_api.py from Prerna43/Shopify_AI: direct link, hf CLI and curl.
- Browser
- Download file 461 Bytes
-
https://huggingface.co/spaces/Prerna43/Shopify_AI/resolve/main/tests/test_api.py
- Command line
-
hf download hf://spaces/Prerna43/Shopify_AI/tests/test_api.py
-
curl -L -o test_api.py https://huggingface.co/spaces/Prerna43/Shopify_AI/resolve/main/tests/test_api.py
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 | |