Files

18 lines
595 B
Python
Raw Permalink Normal View History

2026-09-09 21:55:37 +08:00
from app.core.config import Settings
def test_settings_loads_from_environment(monkeypatch) -> None:
values = {
"JWT_ISSUER": "test",
"JWT_AUDIENCE": "test",
"MYSQL_DSN": "mysql+asyncmy://user:pass@localhost/db",
"REDIS_URL": "redis://localhost/0",
"MILVUS_URI": "http://localhost:19530",
"NEO4J_URI": "bolt://localhost:7687",
}
for key, value in values.items():
monkeypatch.setenv(key, value)
settings = Settings(_env_file=None)
assert settings.timezone == "Asia/Shanghai"
assert settings.worker_retry_limit == 3