65 lines
1.7 KiB
Python
65 lines
1.7 KiB
Python
"""Pytest configuration and fixtures for debate bots tests."""
|
|
|
|
import pytest
|
|
from pathlib import Path
|
|
import tempfile
|
|
import os
|
|
|
|
|
|
@pytest.fixture
|
|
def temp_dir():
|
|
"""Create a temporary directory for tests."""
|
|
with tempfile.TemporaryDirectory() as tmpdir:
|
|
yield Path(tmpdir)
|
|
|
|
|
|
@pytest.fixture
|
|
def sample_config_data():
|
|
"""Sample configuration data for testing."""
|
|
return {
|
|
"agent1": {
|
|
"provider": "openrouter",
|
|
"model": "anthropic/claude-3-haiku",
|
|
"system_prompt": "You are a test agent",
|
|
"api_key": "test_key_123"
|
|
},
|
|
"agent2": {
|
|
"provider": "lmstudio",
|
|
"model": "test-model",
|
|
"base_url": "http://localhost:1234/v1",
|
|
"system_prompt": "You are another test agent"
|
|
}
|
|
}
|
|
|
|
|
|
@pytest.fixture
|
|
def mock_env_vars(monkeypatch):
|
|
"""Set up mock environment variables."""
|
|
monkeypatch.setenv("OPENROUTER_API_KEY", "test_api_key_from_env")
|
|
monkeypatch.setenv("LOG_LEVEL", "DEBUG")
|
|
|
|
|
|
@pytest.fixture
|
|
def sample_debate_history():
|
|
"""Sample debate history for testing."""
|
|
return [
|
|
{
|
|
"exchange": 1,
|
|
"agent": "Agent 1",
|
|
"position": "for",
|
|
"content": "This is the first argument for the position."
|
|
},
|
|
{
|
|
"exchange": 1,
|
|
"agent": "Agent 2",
|
|
"position": "against",
|
|
"content": "This is the counter-argument against the position."
|
|
},
|
|
{
|
|
"exchange": 2,
|
|
"agent": "Agent 1",
|
|
"position": "for",
|
|
"content": "This is the second argument for the position."
|
|
}
|
|
]
|