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:
@@ -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")
|
||||
Reference in New Issue
Block a user