-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_simple.py
More file actions
72 lines (63 loc) · 2.35 KB
/
test_simple.py
File metadata and controls
72 lines (63 loc) · 2.35 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env python3
"""
Simple test to verify basic functionality
"""
import requests
import time
def test_basic_functionality():
"""Test basic app functionality"""
print("🔧 Testing Basic Functionality")
print("=" * 40)
try:
# Test if app is running
response = requests.get("http://localhost:5000/", timeout=5)
if response.status_code == 200:
print("✅ App is running")
else:
print(f"❌ App returned status: {response.status_code}")
return False
except Exception as e:
print(f"❌ Cannot connect to app: {e}")
return False
# Test video test page
try:
response = requests.get("http://localhost:5000/video-test", timeout=5)
if response.status_code == 200:
print("✅ Video test page accessible")
else:
print(f"❌ Video test page failed: {response.status_code}")
except Exception as e:
print(f"❌ Video test page error: {e}")
# Test simple video stream
try:
response = requests.get("http://localhost:5000/simple_video", timeout=10)
if response.status_code == 200:
print("✅ Simple video stream responding")
content_type = response.headers.get('content-type', '')
if 'multipart/x-mixed-replace' in content_type:
print("✅ Correct video stream content type")
else:
print(f"⚠️ Unexpected content type: {content_type}")
else:
print(f"❌ Simple video stream failed: {response.status_code}")
except Exception as e:
print(f"❌ Simple video stream error: {e}")
return True
def main():
print("🎯 Simple Functionality Test")
print("=" * 50)
if test_basic_functionality():
print("\n" + "=" * 50)
print("🎉 Test Summary:")
print("✅ App is running")
print("✅ Video test page works")
print("✅ Video stream endpoint responds")
print("\n📋 Next Steps:")
print("1. Go to http://localhost:5000/video-test")
print("2. You should see your camera feed")
print("3. Then go to http://localhost:5000/exercise")
print("4. Click 'Start Exercise' to test hand tracking")
else:
print("\n❌ Basic functionality test failed")
if __name__ == "__main__":
main()