|
|
|
|
|
""" |
|
|
Test script to verify the app is displaying advanced features |
|
|
""" |
|
|
|
|
|
import requests |
|
|
import json |
|
|
import time |
|
|
|
|
|
def test_app_features(): |
|
|
"""Test if the app is displaying advanced features""" |
|
|
print("π Testing app features...") |
|
|
|
|
|
|
|
|
try: |
|
|
response = requests.get("http://localhost:8501/_stcore/health", timeout=5) |
|
|
if response.status_code == 200: |
|
|
print("β
App is running and healthy") |
|
|
else: |
|
|
print(f"β App health check failed: {response.status_code}") |
|
|
return False |
|
|
except Exception as e: |
|
|
print(f"β App not accessible: {e}") |
|
|
return False |
|
|
|
|
|
|
|
|
try: |
|
|
|
|
|
import sys |
|
|
import os |
|
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) |
|
|
|
|
|
import frontend.app as app |
|
|
|
|
|
|
|
|
if hasattr(app, 'ANALYTICS_AVAILABLE') and app.ANALYTICS_AVAILABLE: |
|
|
print("β
Advanced analytics are available") |
|
|
else: |
|
|
print("β Advanced analytics are not available") |
|
|
return False |
|
|
|
|
|
except Exception as e: |
|
|
print(f"β Analytics check failed: {e}") |
|
|
return False |
|
|
|
|
|
|
|
|
try: |
|
|
from config.settings import DEFAULT_SERIES_LIST |
|
|
if 'PAYEMS' in DEFAULT_SERIES_LIST: |
|
|
print("β
Nonfarm payroll indicator (PAYEMS) is included") |
|
|
else: |
|
|
print("β Nonfarm payroll indicator not found") |
|
|
return False |
|
|
except Exception as e: |
|
|
print(f"β Series list check failed: {e}") |
|
|
return False |
|
|
|
|
|
|
|
|
try: |
|
|
from src.analysis.comprehensive_analytics import ComprehensiveAnalytics |
|
|
print("β
Advanced analytics module is available") |
|
|
except Exception as e: |
|
|
print(f"β Advanced analytics module not available: {e}") |
|
|
return False |
|
|
|
|
|
print("\nπ All tests passed! The app should be displaying:") |
|
|
print("- Advanced analytics and visualizations") |
|
|
print("- Nonfarm payroll indicator (PAYEMS)") |
|
|
print("- Real-time economic data") |
|
|
print("- Mathematical fixes and enhanced UI") |
|
|
|
|
|
return True |
|
|
|
|
|
if __name__ == "__main__": |
|
|
print("π§ͺ Testing App Features") |
|
|
print("=" * 50) |
|
|
|
|
|
success = test_app_features() |
|
|
|
|
|
if success: |
|
|
print("\nβ
Your app is running with all the advanced features!") |
|
|
print("π Open http://localhost:8501 in your browser to see:") |
|
|
print(" - Executive Dashboard with real-time data") |
|
|
print(" - Advanced Analytics with mathematical fixes") |
|
|
print(" - Economic Indicators including nonfarm payroll") |
|
|
print(" - Enhanced visualizations and insights") |
|
|
else: |
|
|
print("\nβ οΈ Some features may not be working properly.") |