File size: 1,441 Bytes
00b554e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/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)