scholarbot / eval /test_api.py
Zan18A's picture
feat: scaffold + dataset downloaded
fd7f323
Raw
History Blame Contribute Delete
417 Bytes
from fastapi.testclient import TestClient
from api.main import app
client = TestClient(app)
def test_health():
r = client.get('/health')
assert r.status_code == 200
def test_query():
r = client.post('/query', json={
'question': 'What is attention in transformers?',
'top_k': 2,
'max_new_tokens': 64
})
assert r.status_code == 200
assert len(r.json()['answer']) > 10