| |
| """ |
| 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...") |
| |
| |
| generator = ProfessionalCartoonFilmGenerator() |
| |
| |
| 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: |
| |
| 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) |