""" 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()