File size: 1,077 Bytes
96f9e36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
32
33
34
35
36
37
38
39
40
41
42
#!/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()