-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_api.py
More file actions
32 lines (26 loc) · 992 Bytes
/
test_api.py
File metadata and controls
32 lines (26 loc) · 992 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
# test_api.py
import requests
BASE_URL = "http://localhost:8000"
print("🧪 Testing FitMentor AI API\n")
# Test 1: Health Check
print("1. Testing health check...")
response = requests.get(f"{BASE_URL}/api/health")
print(f" Status: {response.status_code}")
print(f" Response: {response.json()}\n")
# Test 2: List Exercises
print("2. Testing list exercises...")
response = requests.get(f"{BASE_URL}/api/exercises")
print(f" Status: {response.status_code}")
print(f" Found {len(response.json())} exercises\n")
# Test 3: Get Specific Exercise
print("3. Testing get exercise #1...")
response = requests.get(f"{BASE_URL}/api/exercises/1")
print(f" Status: {response.status_code}")
print(f" Exercise: {response.json()['name']}\n")
print("✅ All basic tests passed!")
print("\nTo test video upload:")
print("1. Go to http://localhost:8000/docs")
print("2. Click on POST /api/analyze")
print("3. Upload a workout video")
print("4. Select exercise type")
print("5. Click 'Execute'")