-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_api.sh
More file actions
33 lines (25 loc) · 698 Bytes
/
Copy pathtest_api.sh
File metadata and controls
33 lines (25 loc) · 698 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 - Automated test script
BASE_URL="http://localhost:8000"
echo "Testing API endpoints..."
# Health check
echo "Health check:"
curl -s $BASE_URL/health
echo -e "\n\nRegister test user:"
curl -s -X POST $BASE_URL/api/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"password": "password123",
"aadhaar_hash": "hash123",
"preferred_language": "en"
}'
echo -e "\n\nLogin:"
TOKEN=$(curl -s -X POST $BASE_URL/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"password": "password123"
}' | jq -r '.access_token')
echo "Token: $TOKEN"
# Add more tests here