test: update test suite for OmegaConf config system
- Add tests/conftest.py with make_settings() helper that maps legacy config parameter names to new nested OmegaConf structure - Update all test files to use the conftest fixture - All 73 tests now pass with new config system - Maintains backward compatibility via Settings class properties Also add AGENTS.md with comprehensive AI agent guidelines: - Project overview and key technologies - Directory structure reference - Development workflow and common tasks - Testing strategy and patterns - CI/CD pipeline overview - Common pitfalls and best practices - Debugging guide for agents working on the project
This commit is contained in:
@@ -10,16 +10,18 @@ import respx
|
||||
from steward.config import Settings
|
||||
from steward.llm.client import LLMClient
|
||||
from steward.proposals.generator import Proposal, ProposalGenerator
|
||||
from tests.conftest import make_settings
|
||||
|
||||
|
||||
def _make_settings(**kwargs) -> Settings:
|
||||
"""Wrapper for test compatibility."""
|
||||
defaults = dict(
|
||||
openai_api_key="test-key",
|
||||
analysis_target_url="https://example.com/api/status",
|
||||
analysis_target_api_key="secret",
|
||||
)
|
||||
defaults.update(kwargs)
|
||||
return Settings(**defaults)
|
||||
return make_settings(**defaults)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -94,6 +96,7 @@ async def test_fetch_sends_bearer_token(settings, mock_llm):
|
||||
def test_proposal_format_for_telegram():
|
||||
"""format_for_telegram() should contain the source URL and body."""
|
||||
from datetime import datetime
|
||||
|
||||
p = Proposal(
|
||||
title="Test",
|
||||
body="**Summary:** All good.",
|
||||
|
||||
Reference in New Issue
Block a user