File size: 1,313 Bytes
223c43b
 
 
 
36bee3f
223c43b
 
 
 
 
 
 
e12b285
 
 
 
 
 
223c43b
e12b285
 
 
223c43b
e12b285
 
 
223c43b
e12b285
 
223c43b
 
 
 
 
 
 
e12b285
 
 
 
 
 
223c43b
 
 
 
 
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
import pytest

from api.audio import STTManager, TTSManager
from api.llm import LLMManager
from utils.config import Config


@pytest.fixture
def app_config():
    return Config()


def test_llm_connection(app_config: Config):
    """
    Test the connection and streaming capability of the LLM.

    :param app_config: Configuration object.
    """
    llm = LLMManager(app_config, {})
    assert llm.status, "LLM connection failed - status check failed"
    assert llm.streaming, "LLM streaming failed - streaming check failed"


def test_stt_connection(app_config: Config):
    """
    Test the connection and streaming capability of the STT.

    :param app_config: Configuration object.
    """
    stt = STTManager(app_config)
    status = stt.status
    streaming = stt.streaming
    assert status, "STT connection failed - status check failed"
    assert streaming, "STT streaming failed - streaming check failed"


def test_tts_connection(app_config: Config):
    """
    Test the connection and streaming capability of the TTS.

    :param app_config: Configuration object.
    """
    tts = TTSManager(app_config)
    status = tts.status
    streaming = tts.streaming
    assert status, "TTS connection failed - status check failed"
    assert streaming, "TTS streaming failed - streaming check failed"