(monkeypatch: pytest.MonkeyPatch)
| 31 | |
| 32 | @pytest.mark.unit |
| 33 | def test_load_provider_config_defaults(monkeypatch: pytest.MonkeyPatch) -> None: |
| 34 | for var in [ |
| 35 | "PAPERFLOW_LLM_PROVIDER", |
| 36 | "PAPERFLOW_LLM_MODEL", |
| 37 | "PAPERFLOW_EMBED_PROVIDER", |
| 38 | "PAPERFLOW_EMBED_MODEL", |
| 39 | "PAPERFLOW_EMBED_DIMENSIONS", |
| 40 | "LLM_PARSER_PROVIDER", |
| 41 | "LLM_PARSER_OPENAI_MODEL", |
| 42 | "DASHSCOPE_LLM_MODEL", |
| 43 | "HF_LLM_MODEL", |
| 44 | "EMBEDDING_PROVIDER", |
| 45 | "EMBEDDING_MODEL", |
| 46 | ]: |
| 47 | monkeypatch.delenv(var, raising=False) |
| 48 | |
| 49 | config = load_provider_config() |
| 50 | assert config.llm_provider == "openai" |
| 51 | assert config.llm_model == "gpt-4o-mini" |
| 52 | assert config.embed_provider == "hash" |
| 53 | assert config.embed_model == "hash" |
| 54 | assert config.embed_dimensions == 768 |
| 55 | |
| 56 | |
| 57 | @pytest.mark.unit |
nothing calls this directly
no test coverage detected