Initial ai typewriter implementation

This commit is contained in:
Hermes Agent
2026-09-11 12:01:35 +02:00
commit 464324aedf
14 changed files with 514 additions and 0 deletions
+24
View File
@@ -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)