#!/usr/bin/env python3 """ Test script for the Professional Cartoon Film Generator """ import os import sys from app import ProfessionalCartoonFilmGenerator def test_generator(): """Test the generator with a simple script""" print("๐Ÿงช Testing Professional Cartoon Film Generator...") # Initialize generator generator = ProfessionalCartoonFilmGenerator() # Test script test_script = """ A brave young explorer discovers a magical forest where talking animals help her find an ancient treasure that will save their enchanted home from eternal winter. """.strip() print(f"๐Ÿ“ Test script: {test_script}") print("\n๐ŸŽฌ Starting generation...") try: # Generate the film final_video, script_data, status = generator.generate_professional_cartoon_film(test_script) print(f"\n๐Ÿ“Š Status: {status}") if final_video and os.path.exists(final_video): print(f"โœ… Success! Video saved to: {final_video}") print(f"๐Ÿ“ File size: {os.path.getsize(final_video) / (1024*1024):.1f} MB") return True else: print("โŒ No video generated") return False except Exception as e: print(f"โŒ Test failed with error: {e}") return False if __name__ == "__main__": success = test_generator() sys.exit(0 if success else 1)