summaryrefslogtreecommitdiffstats
path: root/tests/test_frontmatter.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-05-03 10:58:46 +0200
committerDanilo M. <danix@danix.xyz>2026-05-03 10:58:46 +0200
commit3f23288296c70ab619cfd100a70b900a019b5f7e (patch)
tree82d5aca1e0952cdf58e0fc3e2c2fab50dd7d094a /tests/test_frontmatter.py
parent7ca865ee29ca73373349e3a82f783877e4d51ae8 (diff)
downloadpublisher-3f23288296c70ab619cfd100a70b900a019b5f7e.tar.gz
publisher-3f23288296c70ab619cfd100a70b900a019b5f7e.zip
chore: add CLAUDE.md, HANDOFF.md, design spec, implementation plan, frontmatter fixes
Diffstat (limited to 'tests/test_frontmatter.py')
-rw-r--r--tests/test_frontmatter.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_frontmatter.py b/tests/test_frontmatter.py
index 2257a8a..6cd4b44 100644
--- a/tests/test_frontmatter.py
+++ b/tests/test_frontmatter.py
@@ -1,6 +1,5 @@
import pytest
from pathlib import Path
-import tempfile
from core.frontmatter import parse_frontmatter, write_frontmatter
SAMPLE_MD = """\
@@ -42,6 +41,13 @@ def test_write_preserves_format(tmp_path):
assert fm2["title"] == "Updated Title"
assert fm2["type"] == "Tech"
+def test_write_is_idempotent(tmp_path):
+ f = tmp_path / "index.md"
+ f.write_text(SAMPLE_MD)
+ fm, body = parse_frontmatter(f)
+ write_frontmatter(f, fm, body)
+ assert f.read_text() == SAMPLE_MD
+
def test_parse_raises_on_missing_delimiters(tmp_path):
f = tmp_path / "index.md"
f.write_text("# No frontmatter\n\nJust body.")