| from __future__ import annotations | |
| def test_settings_defaults(monkeypatch): | |
| monkeypatch.setenv("DATABASE_URL", "sqlite+aiosqlite://") | |
| from app.config import Settings | |
| s = Settings() | |
| assert s.llm_provider_order == ["groq", "cloudflare"] | |
| assert s.model_small and s.model_large | |
| assert s.cf_model_small and s.cf_model_large | |
| assert s.order_verify_max_attempts == 5 | |
| def test_provider_order_parses_csv(monkeypatch): | |
| monkeypatch.setenv("LLM_PROVIDER_ORDER", "cloudflare, groq") | |
| from app.config import Settings | |
| s = Settings() | |
| assert s.llm_provider_order == ["cloudflare", "groq"] | |
| def test_bool_flag_parsing(monkeypatch): | |
| monkeypatch.setenv("SHOPIFY_READ_ALL_ORDERS", "1") | |
| from app.config import Settings | |
| assert Settings().shopify_read_all_orders is True | |