chore: clean imports and restore test coverage
This commit is contained in:
@@ -4,8 +4,11 @@ from voice_assistant.agent import MockAgentAdapter
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def text_mock_agent_process_text():
|
||||
agent = MackAgentAdapter()
|
||||
async def test_mock_agent_process_text():
|
||||
"""
|
||||
Verify that the mock Agent returns the expected response.
|
||||
"""
|
||||
agent = MockAgentAdapter()
|
||||
|
||||
response = await agent.process(
|
||||
session_id="session-1",
|
||||
@@ -21,20 +24,21 @@ async def text_mock_agent_process_text():
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_mock_agent_records_call():
|
||||
"""
|
||||
Verify that the mock Agent records its invocation.
|
||||
"""
|
||||
agent = MockAgentAdapter()
|
||||
|
||||
await agent.process(
|
||||
session_id="session-1",
|
||||
turn_id=7,
|
||||
text= "Olá",
|
||||
text="Olá",
|
||||
)
|
||||
|
||||
|
||||
assert agent.calls == [
|
||||
(
|
||||
"session-1",
|
||||
7,
|
||||
"Olá",
|
||||
)
|
||||
]
|
||||
|
||||
]
|
||||
@@ -37,7 +37,6 @@ Architecture:
|
||||
import pytest
|
||||
import yaml
|
||||
|
||||
from voice_assistant.config.loader import load_config
|
||||
from voice_assistant.config.loader import (
|
||||
load_config,
|
||||
load_provider_catalog,
|
||||
@@ -167,7 +166,7 @@ def test_load_provider_catalog_missing_file(tmp_path):
|
||||
)
|
||||
|
||||
|
||||
def test_load_config_uses_app_env(
|
||||
def test_load_config_uses_development_app_env(
|
||||
tmp_path,
|
||||
monkeypatch,
|
||||
):
|
||||
@@ -220,7 +219,7 @@ def test_load_config_rejects_unknown_environment(
|
||||
config_dir=tmp_path,
|
||||
)
|
||||
|
||||
def test_load_config_uses_app_env(
|
||||
def test_load_config_uses_staging_app_env(
|
||||
tmp_path,
|
||||
monkeypatch,
|
||||
):
|
||||
@@ -273,16 +272,3 @@ agent:
|
||||
|
||||
assert config.agent.provider == "mock"
|
||||
|
||||
|
||||
def test_load_config_rejects_unknown_environment(
|
||||
tmp_path,
|
||||
):
|
||||
with pytest.raises(
|
||||
FileNotFoundError,
|
||||
match="Configuration file not found",
|
||||
):
|
||||
load_config(
|
||||
environment="does-not-exist",
|
||||
config_dir=tmp_path,
|
||||
)
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ from voice_assistant.audio_gateway.app.protocol import (
|
||||
)
|
||||
|
||||
# Teste Agent
|
||||
from voice_assistant.agent.adapter import AgentAdapter
|
||||
from voice_assistant.agent.mock import MockAgentAdapter
|
||||
|
||||
# Teste TTS
|
||||
|
||||
@@ -56,18 +56,6 @@ def test_cannot_start_second_turn():
|
||||
manager.start(2)
|
||||
|
||||
|
||||
def test_cannot_stop_before_completed():
|
||||
manager = TurnManager()
|
||||
|
||||
manager.start(1)
|
||||
|
||||
with pytest.raises(
|
||||
RuntimeError,
|
||||
match="final transcript",
|
||||
):
|
||||
manager.stop(1)
|
||||
|
||||
|
||||
def test_interrupt():
|
||||
manager = TurnManager()
|
||||
|
||||
@@ -152,7 +140,7 @@ def test_tts_completion_requires_speaking_state():
|
||||
manager.on_tts_complete(1)
|
||||
|
||||
|
||||
def test_cannot_stop_before_completed():
|
||||
def test_cannot_stop_while_listening():
|
||||
manager = TurnManager()
|
||||
|
||||
manager.start(1)
|
||||
|
||||
Reference in New Issue
Block a user