Spaces:
Running
Running
#!/usr/bin/env python3 | |
""" | |
Test script for HackRx 6.0 app | |
""" | |
import requests | |
import time | |
def test_endpoints(): | |
base_url = "http://localhost:7860" | |
endpoints = [ | |
"/", | |
"/health", | |
"/test", | |
"/docs" | |
] | |
print("π§ͺ Testing HackRx 6.0 endpoints...") | |
for endpoint in endpoints: | |
try: | |
url = base_url + endpoint | |
print(f"\nπ Testing: {url}") | |
response = requests.get(url, timeout=10) | |
print(f"β Status: {response.status_code}") | |
if response.status_code == 200: | |
print(f"π Response: {response.text[:200]}...") | |
else: | |
print(f"β Error: {response.text}") | |
except requests.exceptions.ConnectionError: | |
print(f"β Connection failed - is the app running on {base_url}?") | |
except Exception as e: | |
print(f"β Error testing {endpoint}: {e}") | |
print("\nπ― Test completed!") | |
if __name__ == "__main__": | |
test_endpoints() |