From 41e2c43bd9e77136b51ba0dce47c46d2926f42af Mon Sep 17 00:00:00 2001 From: Edern Deneuville Date: Fri, 11 Sep 2026 12:00:26 +0200 Subject: [PATCH] Initial ai typewriter implementation --- tests/test_config.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/test_config.py diff --git a/tests/test_config.py b/tests/test_config.py new file mode 100644 index 0000000..78c58c9 --- /dev/null +++ b/tests/test_config.py @@ -0,0 +1,24 @@ +import json + +import pytest + +from ai_typewriter.config import load_config + + +def test_load_default_config(tmp_path): + path = tmp_path / "config.json" + path.write_text(json.dumps({"provider": "ollama"}), encoding="utf-8") + + cfg = load_config(path) + + assert cfg.provider == "ollama" + assert cfg.hotkey == "ctrl+alt+a" + assert "Réponds directement" in cfg.system_prompt + + +def test_reject_invalid_provider(tmp_path): + path = tmp_path / "config.json" + path.write_text(json.dumps({"provider": "bad"}), encoding="utf-8") + + with pytest.raises(ValueError): + load_config(path)