Molodetz blogrol volgens DPP-template

This commit is contained in:
2026-10-05 09:36:20 +02:00
commit f290a4c766
277 changed files with 15758 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
# retoor <retoor@molodetz.nl>
import io
from pypdf import PdfWriter
from molodetz.cli import build_parser
from molodetz.cli.commands import read_source
def test_parser_groups():
parser = build_parser()
args = parser.parse_args(["posts", "import", "notitie.md", "--topic", "standaard"])
assert args.topic == "standaard" and args.path == "notitie.md"
args = parser.parse_args(["system", "prune", "--dry-run"])
assert args.dry_run is True
args = parser.parse_args(["role", "set", "retoor", "Admin"])
assert args.role == "Admin"
def test_read_markdown(tmp_path):
path = tmp_path / "x.md"
path.write_text("# Kop\n\nTekst", encoding="utf-8")
assert read_source(path).startswith("# Kop")
def test_read_pdf(tmp_path):
writer = PdfWriter()
writer.add_blank_page(width=200, height=200)
buffer = io.BytesIO()
writer.write(buffer)
path = tmp_path / "x.pdf"
path.write_bytes(buffer.getvalue())
assert read_source(path) == ""