cv-buddy-backend / tests /integration /test_full_flow.py
Momal's picture
Deploy cv-buddy backend
366c43e
raw
history blame contribute delete
767 Bytes
import pytest
from fastapi.testclient import TestClient
from app.main import app
@pytest.fixture
def client():
return TestClient(app)
def test_health_check(client):
response = client.get("/health")
assert response.status_code == 200
assert response.json() == {"status": "ok"}
def test_upload_rejects_invalid_file(client):
response = client.post(
"/api/upload",
files={"file": ("test.txt", b"hello world", "text/plain")},
)
assert response.status_code == 400
assert "Invalid file type" in response.json()["detail"]
def test_analyze_requires_session(client):
response = client.post(
"/api/analyze-job",
json={"job_url": "https://example.com/job"},
)
assert response.status_code == 401