Spaces:
Paused
Paused
VINU NAYAK commited on
Delete test.py
Browse files
test.py
DELETED
|
@@ -1,40 +0,0 @@
|
|
| 1 |
-
import requests
|
| 2 |
-
import sys
|
| 3 |
-
import time
|
| 4 |
-
|
| 5 |
-
def test_app(base_url="http://localhost:7860"):
|
| 6 |
-
"""
|
| 7 |
-
Test the background removal API
|
| 8 |
-
|
| 9 |
-
Args:
|
| 10 |
-
base_url (str): The base URL of the API
|
| 11 |
-
"""
|
| 12 |
-
print(f"Testing API at {base_url}")
|
| 13 |
-
|
| 14 |
-
# Test root endpoint
|
| 15 |
-
try:
|
| 16 |
-
response = requests.get(base_url)
|
| 17 |
-
print(f"Root endpoint status: {response.status_code}")
|
| 18 |
-
if response.status_code == 200:
|
| 19 |
-
print("Root endpoint test: PASSED")
|
| 20 |
-
else:
|
| 21 |
-
print("Root endpoint test: FAILED")
|
| 22 |
-
except Exception as e:
|
| 23 |
-
print(f"Root endpoint test error: {str(e)}")
|
| 24 |
-
|
| 25 |
-
# Test health endpoint
|
| 26 |
-
try:
|
| 27 |
-
response = requests.get(f"{base_url}/health")
|
| 28 |
-
print(f"Health endpoint status: {response.status_code}")
|
| 29 |
-
if response.status_code == 200:
|
| 30 |
-
print("Health endpoint test: PASSED")
|
| 31 |
-
print("Health data:", response.json())
|
| 32 |
-
else:
|
| 33 |
-
print("Health endpoint test: FAILED")
|
| 34 |
-
except Exception as e:
|
| 35 |
-
print(f"Health endpoint test error: {str(e)}")
|
| 36 |
-
|
| 37 |
-
if __name__ == "__main__":
|
| 38 |
-
# Get base URL from command line argument or use default
|
| 39 |
-
base_url = sys.argv[1] if len(sys.argv) > 1 else "http://localhost:7860"
|
| 40 |
-
test_app(base_url)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|