#!/usr/bin/env python3
"""
Test that the modified asr_processor.py imports correctly and has retry logic.
"""

import sys
import os

# Add scripts directory to path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "scripts"))

try:
    from asr_processor import run_asr, save_checkpoint, load_checkpoint

    print("✅ Import successful")
    print(f"run_asr function: {run_asr}")
    print(f"save_checkpoint function: {save_checkpoint}")
    print(f"load_checkpoint function: {load_checkpoint}")

    # Check if retry logic is in the file
    with open("scripts/asr_processor.py", "r") as f:
        content = f.read()

    if "max_retries = 3" in content:
        print("✅ Retry logic found in code")
    else:
        print("❌ Retry logic not found")

    if "save_checkpoint" in content:
        print("✅ Checkpoint functions found")
    else:
        print("❌ Checkpoint functions not found")

except ImportError as e:
    print(f"❌ Import failed: {e}")
    sys.exit(1)

print("\n✅ Test completed successfully")
