refactor: rename all agents and improve structure pt1

ref: N25B-257
This commit is contained in:
Björn Otgaar
2025-11-12 11:04:49 +01:00
parent 781a05328f
commit 0e45383027
37 changed files with 199 additions and 201 deletions

View File

@@ -3,7 +3,7 @@ from unittest.mock import AsyncMock, MagicMock
import pytest
from control_backend.agents.belief_collector.behaviours.continuous_collect import (
from control_backend.agents.bel_agents.bel_collector_agent.behaviours.continuous_collect import (
ContinuousBeliefCollector,
)
@@ -20,7 +20,7 @@ def create_mock_message(sender_node: str, body: str) -> MagicMock:
def mock_agent(mocker):
"""Fixture to create a mock Agent."""
agent = MagicMock()
agent.jid = "belief_collector_agent@test"
agent.jid = "bel_collector_agent@test"
return agent
@@ -68,7 +68,7 @@ async def test_routes_to_handle_belief_text_by_type(continuous_collector, mocker
@pytest.mark.asyncio
async def test_routes_to_handle_belief_text_by_sender(continuous_collector, mocker):
msg = create_mock_message(
"belief_text_agent_mock", json.dumps({"beliefs": {"user_said": [["hi"]]}})
"bel_text_agent_mock", json.dumps({"beliefs": {"user_said": [["hi"]]}})
)
spy = mocker.patch.object(continuous_collector, "_handle_belief_text", new=AsyncMock())
await continuous_collector._process_message(msg)
@@ -87,7 +87,7 @@ async def test_routes_to_handle_emo_text(continuous_collector, mocker):
async def test_belief_text_happy_path_sends(continuous_collector, mocker):
payload = {"type": "belief_extraction_text", "beliefs": {"user_said": ["hello test", "No"]}}
continuous_collector.send = AsyncMock()
await continuous_collector._handle_belief_text(payload, "belief_text_agent_mock")
await continuous_collector._handle_belief_text(payload, "bel_text_agent_mock")
# make sure we attempted a send
continuous_collector.send.assert_awaited_once()