12 lines
493 B
Python
12 lines
493 B
Python
from app.config import Settings
|
|
|
|
|
|
def test_settings_load_from_env(monkeypatch):
|
|
monkeypatch.setenv("DATABASE_URL", "postgresql+asyncpg://u:p@host/db")
|
|
monkeypatch.setenv("OLLAMA_BASE_URL", "http://10.30.20.107:11434")
|
|
monkeypatch.setenv("SESSION_SECRET", "test-secret")
|
|
settings = Settings(_env_file=None)
|
|
assert settings.database_url == "postgresql+asyncpg://u:p@host/db"
|
|
assert settings.ollama_base_url == "http://10.30.20.107:11434"
|
|
assert settings.port == 7777
|