Critical_Code_Agent / CriticalThinking /tests /test_orchestrator.py
AUXteam's picture
Upload folder using huggingface_hub
fc10d08 verified
import pytest
from app.services.agent_orchestrator import AgentOrchestrator
from unittest.mock import MagicMock
def test_orchestrator_flow():
mock_indexer = MagicMock()
mock_indexer.search.return_value = [{"text": "print('hello')"}]
orchestrator = AgentOrchestrator(indexer=mock_indexer, openai_api_key="dummy")
# Run analysis (will use mock responses from BaseAgent._mock_response)
result = orchestrator.run_analysis("A simple python script")
assert "plan" in result
assert "weaknesses" in result
assert result["status"] == "completed"
assert len(result["weaknesses"]) > 0
assert mock_indexer.search.called