Initial commit: WealthWise financial analytics platform

This commit is contained in:
2026-02-14 21:16:57 +05:30
commit b8588df583
171 changed files with 29048 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
"""Tests for health check endpoint."""
import pytest
from fastapi.testclient import TestClient
from app.main import app
client = TestClient(app)
class TestHealthCheck:
"""Test cases for health check endpoint."""
def test_health_endpoint_exists(self):
"""Test that health endpoint is accessible."""
response = client.get("/api/v1/health")
assert response.status_code in [200, 503] # 200 if DB connected, 503 if not
def test_health_response_structure(self):
"""Test that health response has expected structure."""
response = client.get("/api/v1/health")
data = response.json()
assert "status" in data
assert "database" in data
assert "version" in data
def test_readiness_probe(self):
"""Test readiness probe endpoint."""
response = client.get("/api/v1/health/ready")
assert response.status_code == 200
assert response.json() == {"ready": True}
def test_liveness_probe(self):
"""Test liveness probe endpoint."""
response = client.get("/api/v1/health/live")
assert response.status_code == 200
assert response.json() == {"alive": True}