convert to markdown (#1)

Reviewed-on: #1
This commit is contained in:
Miguel Jacq 2025-11-08 00:30:46 -06:00
parent 31604a0cd2
commit 39576ac7f3
54 changed files with 1616 additions and 4012 deletions

36
tests/test_settings.py Normal file
View file

@ -0,0 +1,36 @@
from pathlib import Path
from bouquin.settings import (
default_db_path,
get_settings,
load_db_config,
save_db_config,
)
from bouquin.db import DBConfig
def test_default_db_path_returns_writable_path(app, tmp_path):
p = default_db_path()
assert isinstance(p, Path)
p.parent.mkdir(parents=True, exist_ok=True)
def test_load_and_save_db_config_roundtrip(app, tmp_path):
s = get_settings()
for k in ["db/path", "db/key", "ui/idle_minutes", "ui/theme", "ui/move_todos"]:
s.remove(k)
cfg = DBConfig(
path=tmp_path / "notes.db",
key="abc123",
idle_minutes=7,
theme="dark",
move_todos=True,
)
save_db_config(cfg)
loaded = load_db_config()
assert loaded.path == cfg.path
assert loaded.key == cfg.key
assert loaded.idle_minutes == cfg.idle_minutes
assert loaded.theme == cfg.theme
assert loaded.move_todos == cfg.move_todos