Multi-stage Chain-of-Thought reasoning service with: - FastAPI service using lilith-ml-service-base - Pipeline orchestration via lilith-pipeline-framework - LLM client using lilith-ollama-provider - TypeScript client package @lilith/cot-client - Service-addresses integration for port resolution (8110) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
"""Pytest configuration and fixtures for cot-reasoning tests."""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
from unittest.mock import AsyncMock, MagicMock
|
|
|
|
import pytest
|
|
|
|
# Add service src to path for imports
|
|
service_src = Path(__file__).parent.parent / "src"
|
|
sys.path.insert(0, str(service_src))
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_config():
|
|
"""Mock configuration for tests."""
|
|
from service.src.config import AppConfig, ServiceConfig, LLMConfig, ReasoningConfig
|
|
|
|
return AppConfig(
|
|
service=ServiceConfig(name="cot-reasoning-test", port=8110, host="127.0.0.1"),
|
|
llm=LLMConfig(backend="ollama", host="http://localhost:11434", model="test-model"),
|
|
reasoning=ReasoningConfig(default_stages=["analyze"]),
|
|
)
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_llm_response():
|
|
"""Standard mock LLM response."""
|
|
return '{"confidence": 0.9, "result": "test", "understanding": "test input"}'
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_ollama_provider():
|
|
"""Mock OllamaAsyncProvider."""
|
|
mock = AsyncMock()
|
|
mock.chat.return_value = MagicMock(
|
|
message=MagicMock(content='{"confidence": 0.9, "result": "test"}')
|
|
)
|
|
mock.health_check.return_value = MagicMock(status="ok")
|
|
return mock
|