zotero-kb/tests/test_config.py
2026-04-16 13:34:39 +08:00

12 lines
458 B
Python

from zotero_kb.config import AppConfig
def test_from_env_normalizes_bridge_directory_path(monkeypatch, tmp_path) -> None:
monkeypatch.setenv("ZOTERO_KB_WORKSPACE", str(tmp_path / "workspace"))
monkeypatch.setenv("ZOTERO_DATA_DIR", str(tmp_path / "zotero"))
monkeypatch.setenv("ZOTERO_BRIDGE_FILE", "workspace/bridge/")
config = AppConfig.from_env()
assert config.bridge_file == config.workspace_dir / "bridge" / "selected-items.json"