Add tests for the health endpoint.

This commit is contained in:
2025-11-14 10:27:30 +02:00
parent c8b724fd29
commit d5d204c642
3 changed files with 27 additions and 0 deletions
View File
+10
View File
@@ -0,0 +1,10 @@
import pytest
import requests
BASE_URL = "http://localhost:8000"
@pytest.fixture(scope="session")
def api_client():
"""Fixture for API client"""
return requests.Session()
+17
View File
@@ -0,0 +1,17 @@
import pytest
import requests
from typing import Dict, Any
from .conftest import BASE_URL
class TestHealthCheck:
"""health check endpoint"""
def test_health_endpoint(self, api_client):
"""For /health endpoint"""
response = api_client.get(f"{BASE_URL}/health")
assert response.status_code == 200
data = response.json()
assert "status" in data
assert data["status"] == "healthy"
assert "model_loaded" in data