from fastapi.testclient import TestClient from src.app.main import app client = TestClient(app) def test_root(): r = client.get('/') assert r.status_code == 200 def test_repair_endpoint(): payload = {"buggy": "def add(a, b)\n return a + b"} r = client.post('/repair', json=payload) assert r.status_code == 200 data = r.json() assert 'fixed' in data and 'explanation' in data