File size: 1,042 Bytes
838a92b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import app

def test_transcribe_audio_to_text():
    input_audio_file = "test_audio_input.wav"
    expected_transcribed_text = "your expected transcription"
    
    result = app.transcribe_audio_to_text(input_audio_file)
    assert result == expected_transcribed_text

def test_call_chatgpt_api():
    prompt = "What is the meaning of life?"
    system_prompt = "Yoda:"
    expected_response = "your expected chatgpt response"
    
    result = app.call_chatgpt_api(prompt, system_prompt)
    assert result == expected_response

def test_text_to_speech_yoda():
    input_text = "Do or do not, there is no try."
    output_audio_file = "test_audio_output.mp3"
    
    app.text_to_speech_yoda(input_text, output_audio_file)
    assert os.path.exists(output_audio_file)

def test_process_audio():
    input_audio_file = "test_audio_input.wav"
    output_audio_file = "test_audio_output.mp3"
    system_prompt = "Yoda:"
    
    app.process_audio(input_audio_file, output_audio_file, system_prompt)
    assert os.path.exists(output_audio_file)