Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /SHAdd0WTAka_Zen-Ai-Pentest /tests /test_api.py
| """ | |
| Unit Tests for REST API | |
| """ | |
| import pytest # noqa: F401 | |
| from fastapi.testclient import TestClient | |
| from api.main import app | |
| client = TestClient(app) | |
| def test_health_check(): | |
| """Test health endpoint""" | |
| response = client.get("/health") | |
| assert response.status_code in [200, 429] | |
| # API returns 'healthy' or 'degraded' depending on Redis availability | |
| assert response.json()["status"] in ["healthy", "degraded"] | |
| def test_get_status(): | |
| """Test status endpoint""" | |
| response = client.get("/health") | |
| assert response.status_code in [200, 429] | |
| data = response.json() | |
| assert "status" in data | |
| def test_invalid_endpoint(): | |
| """Test 404 handling""" | |
| response = client.get("/invalid-endpoint") | |
| assert response.status_code in [404, 429] | |
Xet Storage Details
- Size:
- 783 Bytes
- Xet hash:
- ffd17f4a7f1ec67b6ea27b88f1867ee7279e1c628831e9d7f16e761575fce1e6
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.