"""Test if insights can be imported from backend context."""
import sys
from pathlib import Path

# Replicate the path setup from main.py
backend_path = Path(__file__).parent.parent / "atomizer-dashboard" / "backend" / "api"
sys.path.insert(0, str(backend_path.parent.parent.parent.parent))
sys.path.insert(0, str(backend_path.parent))

print(f"sys.path[0]: {sys.path[0]}")
print(f"sys.path[1]: {sys.path[1]}")

try:
    from api.routes import insights
    print(f"insights module imported: {insights}")
    print(f"insights.router: {insights.router}")
    print(f"routes: {[r.path for r in insights.router.routes]}")
except Exception as e:
    print(f"ERROR importing insights: {e}")
    import traceback
    traceback.print_exc()
