File size: 2,571 Bytes
8024c76 2469150 8024c76 2469150 8024c76 2469150 8024c76 2469150 8024c76 2469150 8024c76 2469150 8024c76 2469150 8024c76 2469150 8024c76 2469150 8024c76 2469150 8024c76 2469150 8024c76 2469150 8024c76 2469150 |
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 |
#!/usr/bin/env python3
"""
Test script to verify all analytics imports work correctly
"""
import sys
import os
# Add the project root to Python path
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
def test_imports():
"""Test all the imports that the analytics need"""
print("π Testing analytics imports...")
# Test 1: Config import
print("\n1. Testing config import...")
try:
from config.settings import Config
print("β
Config import successful")
config = Config()
print(f"β
Config.get_fred_api_key() = {config.get_fred_api_key()}")
except Exception as e:
print(f"β Config import failed: {e}")
return False
# Test 2: Analytics import
print("\n2. Testing analytics import...")
try:
from src.analysis.comprehensive_analytics import ComprehensiveAnalytics
print("β
ComprehensiveAnalytics import successful")
except Exception as e:
print(f"β ComprehensiveAnalytics import failed: {e}")
return False
# Test 3: FRED Client import
print("\n3. Testing FRED client import...")
try:
from src.core.enhanced_fred_client import EnhancedFREDClient
print("β
EnhancedFREDClient import successful")
except Exception as e:
print(f"β EnhancedFREDClient import failed: {e}")
return False
# Test 4: Analytics modules import
print("\n4. Testing analytics modules import...")
try:
from src.analysis.economic_forecasting import EconomicForecaster
from src.analysis.economic_segmentation import EconomicSegmentation
from src.analysis.statistical_modeling import StatisticalModeling
print("β
All analytics modules import successful")
except Exception as e:
print(f"β Analytics modules import failed: {e}")
return False
# Test 5: Create analytics instance
print("\n5. Testing analytics instance creation...")
try:
analytics = ComprehensiveAnalytics(api_key="test_key", output_dir="test_output")
print("β
ComprehensiveAnalytics instance created successfully")
except Exception as e:
print(f"β Analytics instance creation failed: {e}")
return False
print("\nπ All imports and tests passed successfully!")
return True
if __name__ == "__main__":
success = test_imports()
if success:
print("\nβ
All analytics imports are working correctly!")
else:
print("\nβ Some imports failed. Check the errors above.") |