Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /MarkinHaus_ToolBoxV2 /tb-registry /tests /test_health.py
| """Tests for health check endpoints.""" | |
| from fastapi.testclient import TestClient | |
| def test_health_check(client: TestClient) -> None: | |
| """Test health check endpoint. | |
| Args: | |
| client: Test client. | |
| """ | |
| response = client.get("/api/v1/health") | |
| assert response.status_code == 200 | |
| assert response.json() == {"status": "healthy"} | |
| def test_readiness_check(client: TestClient) -> None: | |
| """Test readiness check endpoint returns ready status with details. | |
| Args: | |
| client: Test client. | |
| """ | |
| response = client.get("/api/v1/ready") | |
| assert response.status_code == 200 | |
| data = response.json() | |
| assert data["status"] == "ready" | |
| assert "details" in data | |
| assert "database" in data["details"] | |
| assert "storage" in data["details"] | |
| # Database should be healthy | |
| assert data["details"]["database"] is True | |
| # Storage may be not configured in test mode, but should report healthy | |
| assert data["details"]["storage"]["healthy"] is True | |
| def test_health_check_head(client: TestClient) -> None: | |
| """Test health check HEAD endpoint. | |
| Args: | |
| client: Test client. | |
| """ | |
| response = client.head("/api/v1/health") | |
| assert response.status_code == 200 | |
Xet Storage Details
- Size:
- 1.23 kB
- Xet hash:
- 841f0bd47dde2424ae0759df62c881a32a01e2ab0f3947ba6e5af8bb5495f10e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.