File size: 2,307 Bytes
7466735
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
73
74
75
76
77
78
"""

Quick Test - Run all basic tests at once

"""
import subprocess
import sys

def run_test(name, command):
    """Run a test and display results"""
    print("\n" + "=" * 70)
    print(f"πŸ§ͺ TEST: {name}")
    print("=" * 70)
    
    try:
        result = subprocess.run(
            command,
            shell=True,
            capture_output=True,
            text=True,
            timeout=30
        )
        
        print(result.stdout)
        if result.stderr:
            print("STDERR:", result.stderr)
        
        return result.returncode == 0
    except subprocess.TimeoutExpired:
        print("❌ Test timed out")
        return False
    except Exception as e:
        print(f"❌ Error: {e}")
        return False


def main():
    print("""

╔══════════════════════════════════════════════════════════════╗

β•‘         SMART PARKING SYSTEM - QUICK TEST SUITE             β•‘

β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

""")
    
    tests = [
        ("Database Slot Check", "python check_slots.py"),
        ("Full Database Integration", "python test_database.py"),
    ]
    
    results = {}
    
    for name, command in tests:
        results[name] = run_test(name, command)
    
    # Summary
    print("\n" + "=" * 70)
    print("πŸ“Š TEST SUMMARY")
    print("=" * 70)
    
    for name, passed in results.items():
        status = "βœ… PASSED" if passed else "❌ FAILED"
        print(f"{status}: {name}")
    
    total = len(results)
    passed = sum(1 for v in results.values() if v)
    
    print(f"\n Total: {passed}/{total} tests passed")
    
    if passed == total:
        print("\nπŸŽ‰ All tests passed!")
    else:
        print("\n⚠️  Some tests failed. Check the output above.")
    
    print("\nπŸ’‘ To start the API server, run:")
    print("   python backend/main.py")
    print("\nπŸ’‘ Then visit http://127.0.0.1:8000/docs for interactive API testing")


if __name__ == "__main__":
    main()