CoolFace
Apppublic

smart-models/Placebo_AI

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
01_test_environment.py37 linesDownload Raw Back to validation_suite
1import requests2import sys3 4BASE_URL = "http://localhost:8000"5 6def test_environment():7    print("--- Phase 1: Environment & Config Verification ---")8    try:9        # 1. Check FastAPI Backend10        print("[TEST] Pinging FastAPI Backend...")11        res = requests.get(f"{BASE_URL}/about")12        if res.status_code == 200:13            print("✅ FastAPI is running.")14        else:15            print(f"❌ FastAPI Error: Status {res.status_code}")16            17        # 2. Check Config Endpoint (Validates .env loading)18        print("[TEST] Fetching Configuration...")19        res = requests.get(f"{BASE_URL}/config")20        config = res.json()21        if "pogsfhuwkfmmomphward" in config.get("supabase_url", ""):22            print("✅ Supabase URL correctly loaded.")23        else:24            print("❌ Invalid Supabase URL loaded.")25            26        if config.get("supabase_anon_key").startswith("eyJhbGciOi"):27            print("✅ Valid Supabase JWT Anon Key loaded.")28        else:29            print("❌ Invalid Supabase Anon Key detected.")30            31    except Exception as e:32        print(f"❌ Environment Test Failed: {str(e)}")33        sys.exit(1)34 35if __name__ == "__main__":36    test_environment()37