Malware-detection / app /tests /test_api.py
kumar-aditya's picture
Upload 60 files
c8f4a46 verified
Raw
History Blame Contribute Delete
512 Bytes
import pytest
from fastapi.testclient import TestClient
from app.main import app
from app.core.db import Base, engine
client = TestClient(app)
def test_health_endpoint():
response = client.get("/api/health")
assert response.status_code == 200
assert response.json()["status"] == "ok"
def test_upload_missing_file():
response = client.post("/api/resumes/upload", headers={"X-Session-Id": "test-session"})
assert response.status_code == 422 # FastAPI validation error for missing form data