-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_satellite_endpoint.py
More file actions
38 lines (30 loc) · 1.06 KB
/
Copy pathtest_satellite_endpoint.py
File metadata and controls
38 lines (30 loc) · 1.06 KB
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
#!/usr/bin/env python3
"""Test satellite analysis endpoint"""
import requests
import json
# Test satellite analysis endpoint
url = "http://127.0.0.1:3001/api/satellite/analyze"
payload = {
"latitude": 21.1458,
"longitude": 79.0882,
"radius_km": 5.0,
"analysis_type": "vegetation"
}
print("🧪 Testing Satellite Analysis Endpoint")
print(f"URL: {url}")
print(f"Payload: {json.dumps(payload, indent=2)}")
print("\n" + "="*50 + "\n")
try:
response = requests.post(url, json=payload, timeout=10)
print(f"✅ Status Code: {response.status_code}")
print(f"\n📊 Response:")
print(json.dumps(response.json(), indent=2))
if response.status_code == 200:
print("\n✨ Satellite analysis endpoint is working!")
else:
print(f"\n⚠️ Unexpected status code: {response.status_code}")
except requests.exceptions.ConnectionError:
print("❌ Error: Could not connect to backend service")
print(" Make sure the backend is running on http://127.0.0.1:3001")
except Exception as e:
print(f"❌ Error: {e}")