feat: establish voice assistant V1 baseline
This commit is contained in:
32
tests/test_tts_adapter.py
Normal file
32
tests/test_tts_adapter.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import pytest
|
||||
|
||||
from voice_assistant.tts import MockTTSAdapter
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_mock_tts_synthesizes_audio_chunks():
|
||||
tts= MockTTSAdapter()
|
||||
|
||||
chunks = [
|
||||
chunk
|
||||
async for chunk in tts.synthesize("Olá, tudo bem?")
|
||||
]
|
||||
|
||||
assert chunks == [
|
||||
b"\x01\x02\x03\x04",
|
||||
b"\x05\x06\x07\x08",
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_mock_tts_records_text():
|
||||
tts = MockTTSAdapter()
|
||||
|
||||
chunks = [
|
||||
chunk
|
||||
async for chunk in tts.synthesize("Olá")
|
||||
]
|
||||
|
||||
assert chunks
|
||||
assert tts.calls == ["Olá"], "A mensagem de retorno deve ser Olá"
|
||||
|
||||
Reference in New Issue
Block a user