Buckets:

tahamajs's picture
download
raw
1.14 kB
from fastapi.testclient import TestClient
from backend.app.main import app
client = TestClient(app)
def test_health() -> None:
response = client.get('/health')
assert response.status_code == 200
assert response.json()['status'] == 'ok'
def test_demo_contract() -> None:
response = client.post('/api/demo', json={'input': 'A test statement.', 'domain': 'Toxicity', 'adversary_style': 'Logical challenge', 'pressure_strength': 3})
assert response.status_code == 200
payload = response.json()
assert {'initial_verdict', 'final_verdict', 'outcome', 'stability_score', 'evidence_phrases'} <= payload.keys()
def test_metrics_and_dataset() -> None:
metrics = client.get('/api/metrics?dataset=GSM8K&baseline=AEGIS')
dataset = client.get('/api/dataset?page=1&page_size=5&search=math')
assert metrics.status_code == 200
assert metrics.json()['dataset'] == 'GSM8K'
assert dataset.status_code == 200
assert dataset.json()['page_size'] == 5
def test_models() -> None:
response = client.get('/api/models')
assert response.status_code == 200
assert 'judge_models' in response.json()

Xet Storage Details

Size:
1.14 kB
·
Xet hash:
ee344146a8e69ebfd6da88b51d62195f1a7b2692cbf07e98f672f067146c622b

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.