File size: 1,819 Bytes
51d8aa9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
49
50
51
52
53
54
55
56
#!/usr/bin/env python3
"""
Simple test script to verify the one-pager generator functionality
"""

import sys
import os

# Add the current directory to the path so we can import our app
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))

def test_basic_functionality():
    """Test basic app functionality without launching the full interface"""
    try:
        from app import generate_onepager, initialize_model
        
        print("🧪 Testing One-Pager Generator...")
        print("Initializing model...")
        
        # Initialize the model
        init_result = initialize_model()
        print(f"Model initialization: {init_result}")
        
        # Test generation with sample data
        print("\n📝 Testing one-pager generation...")
        test_topic = "Artificial Intelligence in Healthcare"
        test_audience = "Healthcare professionals"
        test_keypoints = "Machine learning applications, Data privacy concerns, Cost-effectiveness, Implementation challenges"
        test_tone = "Professional"
        test_length = "Medium"
        
        result = generate_onepager(
            topic=test_topic,
            target_audience=test_audience,
            key_points=test_keypoints,
            tone=test_tone,
            length=test_length
        )
        
        print("Generated One-Pager:")
        print("-" * 50)
        print(result)
        print("-" * 50)
        
        if "Error" not in result:
            print("✅ Test passed! One-pager generated successfully.")
        else:
            print("❌ Test failed! Error in generation.")
            
    except Exception as e:
        print(f"❌ Test failed with exception: {str(e)}")
        import traceback
        traceback.print_exc()

if __name__ == "__main__":
    test_basic_functionality()