Add tests for the health endpoint.

main
KKlochko 1 month ago
parent c8b724fd29
commit d5d204c642
Signed by: KKlochko
GPG Key ID: 572ECCD219BBA91B

@ -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()

@ -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
Loading…
Cancel
Save