feat(config): añade Settings con Pydantic Settings y .env loading

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Juan
2026-05-10 10:16:07 +02:00
co-authored by Claude Opus 4.7
parent ad77efe366
commit 60c2bff322
2 changed files with 71 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
"""Tests de configuración."""
import os
from pathlib import Path
from unittest.mock import patch
from agentforge_core.config import Settings
def test_settings_defaults_seguros() -> None:
with patch.dict(os.environ, {}, clear=True):
s = Settings(_env_file=None) # type: ignore[call-arg]
assert s.llm_provider == "mock"
assert s.guardrails_nemo_enabled is False
assert s.log_level == "INFO"
def test_settings_data_dir_se_resuelve() -> None:
with patch.dict(os.environ, {"DATA_DIR": "/tmp/agentforge-test"}, clear=True):
s = Settings(_env_file=None) # type: ignore[call-arg]
assert s.data_dir == Path("/tmp/agentforge-test")