#!/usr/bin/env python3
"""Quick test to verify Data Analysis.py works correctly."""
import subprocess
import sys

result = subprocess.run([sys.executable, 'Data Analysis.py'], capture_output=True, text=True, timeout=30)
print("STDOUT:")
print(result.stdout[-2000:] if len(result.stdout) > 2000 else result.stdout)
print("\nSTDERR:")
print(result.stderr[-1000:] if len(result.stderr) > 1000 else result.stderr)
print(f"\nExit code: {result.returncode}")

# Check for plot files
import os
plot_files = sorted([f for f in os.listdir('plots') if f.endswith('.png')])
print(f"\nGenerated {len(plot_files)} plot files:")
for f in plot_files:
    print(f"  - {f}")
