hackrx / test_app.py
Manjesh501's picture
Fix H
96f9e36
#!/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()