replacebg / test_generator.py
Munaf1987's picture
Create test_generator.py
00b554e verified
raw
history blame
1.44 kB
#!/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)