test: fix tests
ref: N25B-401
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import json
|
import json
|
||||||
from unittest.mock import AsyncMock, MagicMock
|
from unittest.mock import AsyncMock, MagicMock, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import zmq
|
import zmq
|
||||||
@@ -19,6 +19,12 @@ def zmq_context(mocker):
|
|||||||
return mock_context
|
return mock_context
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def mock_experiment_logger():
|
||||||
|
with patch("control_backend.agents.actuation.robot_gesture_agent.experiment_logger") as logger:
|
||||||
|
yield logger
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_setup_bind(zmq_context, mocker):
|
async def test_setup_bind(zmq_context, mocker):
|
||||||
"""Setup binds and subscribes to internal commands."""
|
"""Setup binds and subscribes to internal commands."""
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ def agent():
|
|||||||
return agent
|
return agent
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def mock_experiment_logger():
|
||||||
|
with patch("control_backend.agents.bdi.bdi_core_agent.experiment_logger") as logger:
|
||||||
|
yield logger
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_setup_loads_asl(mock_agentspeak_env, agent):
|
async def test_setup_loads_asl(mock_agentspeak_env, agent):
|
||||||
# Mock file opening
|
# Mock file opening
|
||||||
|
|||||||
@@ -18,6 +18,12 @@ def mock_httpx_client():
|
|||||||
yield mock_client
|
yield mock_client
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def mock_experiment_logger():
|
||||||
|
with patch("control_backend.agents.llm.llm_agent.experiment_logger") as logger:
|
||||||
|
yield logger
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_llm_processing_success(mock_httpx_client, mock_settings):
|
async def test_llm_processing_success(mock_httpx_client, mock_settings):
|
||||||
# Setup the mock response for the stream
|
# Setup the mock response for the stream
|
||||||
|
|||||||
@@ -14,6 +14,15 @@ from control_backend.agents.perception.transcription_agent.transcription_agent i
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def mock_experiment_logger():
|
||||||
|
with patch(
|
||||||
|
"control_backend.agents.perception"
|
||||||
|
".transcription_agent.transcription_agent.experiment_logger"
|
||||||
|
) as logger:
|
||||||
|
yield logger
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_transcription_agent_flow(mock_zmq_context):
|
async def test_transcription_agent_flow(mock_zmq_context):
|
||||||
mock_sub = MagicMock()
|
mock_sub = MagicMock()
|
||||||
|
|||||||
@@ -30,6 +30,14 @@ def agent():
|
|||||||
return agent
|
return agent
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def mock_experiment_logger():
|
||||||
|
with patch(
|
||||||
|
"control_backend.agents.user_interrupt.user_interrupt_agent.experiment_logger"
|
||||||
|
) as logger:
|
||||||
|
yield logger
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_send_to_speech_agent(agent):
|
async def test_send_to_speech_agent(agent):
|
||||||
"""Verify speech command format."""
|
"""Verify speech command format."""
|
||||||
|
|||||||
Reference in New Issue
Block a user