File size: 1,070 Bytes
94dc091
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""
Test script for the start() function
"""

from parse import start

def test_start_function():
    """Test the start function with different speakers"""
    
    print("πŸ§ͺ Testing start() function with different speakers\n")
    
    # Test with 'question' speaker (first level questions)
    print("πŸ“’ Results for speaker 'question':")
    results = start('question')
    print(f"Found {len(results)} questions")
    for i, result in enumerate(results[:3]):  # Show first 3
        print(f"  {i+1}. {result['message']}")
        print(f"     Audio: {result['audio'] if result['audio'] else 'No audio'}")
    
    print("\n" + "-"*50)
    
    # Test with a non-existent speaker
    print("πŸ“’ Results for speaker 'non_existent':")
    results = start('non_existent')
    print(f"Found {len(results)} results")
    
    print("\n" + "-"*50)
    
    # Test with empty speaker
    print("πŸ“’ Results for speaker '':")
    results = start('')
    print(f"Found {len(results)} results")

if __name__ == "__main__":
    test_start_function()