Spaces:
Sleeping
Sleeping
IliaLarchenko
commited on
Commit
·
223c43b
1
Parent(s):
22bf23c
Added simple tests
Browse files- test.py +7 -0
- tests/test_models.py +37 -0
test.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# test.py in your project root
|
2 |
+
|
3 |
+
import pytest
|
4 |
+
|
5 |
+
if __name__ == "__main__":
|
6 |
+
# Run pytest on the tests directory
|
7 |
+
pytest.main(["-v", "./tests"])
|
tests/test_models.py
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pytest
|
2 |
+
|
3 |
+
from api.audio import STTManager, TTSManager
|
4 |
+
from api.llm import LLMManager
|
5 |
+
from config import Config
|
6 |
+
|
7 |
+
# Simple placeholder tests so far
|
8 |
+
# TODO: add more tests including LLM based
|
9 |
+
|
10 |
+
|
11 |
+
@pytest.fixture
|
12 |
+
def app_config():
|
13 |
+
return Config()
|
14 |
+
|
15 |
+
|
16 |
+
def test_llm_connection(app_config):
|
17 |
+
llm = LLMManager(app_config, {})
|
18 |
+
status = llm.status
|
19 |
+
streaming = llm.streaming
|
20 |
+
assert status, "LLM connection failed - status check failed"
|
21 |
+
assert streaming, "LLM streaming failed - streaming check failed"
|
22 |
+
|
23 |
+
|
24 |
+
def test_stt_connection(app_config):
|
25 |
+
stt = STTManager(app_config)
|
26 |
+
status = stt.status
|
27 |
+
streaming = stt.streaming
|
28 |
+
assert status, "STT connection failed - status check failed"
|
29 |
+
assert streaming, "STT streaming failed - streaming check failed"
|
30 |
+
|
31 |
+
|
32 |
+
def test_tts_connection(app_config):
|
33 |
+
tts = TTSManager(app_config)
|
34 |
+
status = tts.status
|
35 |
+
streaming = tts.streaming
|
36 |
+
assert status, "TTS connection failed - status check failed"
|
37 |
+
assert streaming, "TTS streaming failed - streaming check failed"
|