File size: 743 Bytes
7a56b52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import sys
import os
import json
from fastapi.testclient import TestClient

# Must run from inside gov_backend directory for imports to work
sys.path.insert(0, os.path.abspath("."))
from api import app

client = TestClient(app)

print("--- Testing /health ---")
response = client.get("/health")
print(response.json())

print("\n--- Testing /api/gazette/search ---")
payload = {
    "query": "solar power tax exemption",
    "limit": 5
}
response = client.post("/api/gazette/search", json=payload)
data = response.json()

print(json.dumps(data, indent=2))

if data.get("results"):
    print("\nSUCCESS: Hybrid search pipeline integrated correctly with learned weights!")
else:
    print("\nNo results found, but endpoint responded correctly.")