-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_api.sh
More file actions
executable file
·33 lines (27 loc) · 890 Bytes
/
test_api.sh
File metadata and controls
executable file
·33 lines (27 loc) · 890 Bytes
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
#!/bin/bash
# test_api.sh - Test script for deepfake detection API
API_URL="${API_URL:-http://localhost:8080}"
echo "Testing Deepfake Detection API"
echo "=================================="
echo ""
# Test 1: Health Check
echo "Testing health endpoint..."
curl -s "${API_URL}/health" | python3 -m json.tool
echo ""
# Test 2: Root endpoint
echo "Testing root endpoint..."
curl -s "${API_URL}/" | python3 -m json.tool
echo ""
# Test 3: Deepfake detection (requires test image)
if [ -f "test_image.jpg" ]; then
echo "Testing deepfake detection..."
curl -s -X POST "${API_URL}/api/v1/detect/deepfake" \
-F "file=@test_image.jpg" \
-F "include_visualization=false" | python3 -m json.tool
echo ""
else
echo "Skipping detection test - test_image.jpg not found"
echo " Create a test_image.jpg to test detection"
echo ""
fi
echo "API tests complete!"