Files
voiceagent/tests/test_agent.py

41 lines
731 B
Python

import pytest
from voice_assistant.agent import MockAgentAdapter
@pytest.mark.anyio
async def text_mock_agent_process_text():
agent = MackAgentAdapter()
response = await agent.process(
session_id="session-1",
turn_id=1,
text="Qual o horário de funcionamento?",
)
assert response == (
"Resposta simulada para: "
"Qual o horário de funcionamento?"
)
@pytest.mark.anyio
async def test_mock_agent_records_call():
agent = MockAgentAdapter()
await agent.process(
session_id="session-1",
turn_id=7,
text= "Olá",
)
assert agent.calls == [
(
"session-1",
7,
"Olá",
)
]