Spaces:
Sleeping
Sleeping
Download scripts/validation_suite/01_test_environment.py from TrinetraLabs/Placebo_AI: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/spaces/TrinetraLabs/Placebo_AI/resolve/main/scripts/validation_suite/01_test_environment.py
- Command line
-
hf download hf://spaces/TrinetraLabs/Placebo_AI/scripts/validation_suite/01_test_environment.py
-
curl -L -o 01_test_environment.py https://huggingface.co/spaces/TrinetraLabs/Placebo_AI/resolve/main/scripts/validation_suite/01_test_environment.py
1.23 kB
| import requests | |
| import sys | |
| BASE_URL = "http://localhost:8000" | |
| def test_environment(): | |
| print("--- Phase 1: Environment & Config Verification ---") | |
| try: | |
| # 1. Check FastAPI Backend | |
| print("[TEST] Pinging FastAPI Backend...") | |
| res = requests.get(f"{BASE_URL}/about") | |
| if res.status_code == 200: | |
| print("✅ FastAPI is running.") | |
| else: | |
| print(f"❌ FastAPI Error: Status {res.status_code}") | |
| # 2. Check Config Endpoint (Validates .env loading) | |
| print("[TEST] Fetching Configuration...") | |
| res = requests.get(f"{BASE_URL}/config") | |
| config = res.json() | |
| if "pogsfhuwkfmmomphward" in config.get("supabase_url", ""): | |
| print("✅ Supabase URL correctly loaded.") | |
| else: | |
| print("❌ Invalid Supabase URL loaded.") | |
| if config.get("supabase_anon_key").startswith("eyJhbGciOi"): | |
| print("✅ Valid Supabase JWT Anon Key loaded.") | |
| else: | |
| print("❌ Invalid Supabase Anon Key detected.") | |
| except Exception as e: | |
| print(f"❌ Environment Test Failed: {str(e)}") | |
| sys.exit(1) | |
| if __name__ == "__main__": | |
| test_environment() | |