Files
transcription/tests/test_prompts.py
T
2026-06-26 18:19:09 -05:00

42 lines
1.4 KiB
Python

"""Tests for prompt artifacts in prompts/."""
from pathlib import Path
PROMPT_PATH = Path("prompts/transcribe_document.md")
def _prompt_text() -> str:
"""Read prompt text from the canonical prompt file."""
return PROMPT_PATH.read_text(encoding="utf-8")
class TestPromptArtifact:
"""Verify prompt artifact presence and baseline semantics."""
def test_prompt_file_exists(self):
"""Canonical transcription prompt file exists."""
assert PROMPT_PATH.exists()
def test_prompt_file_is_not_empty(self):
"""Canonical prompt file has non-whitespace content."""
text = _prompt_text()
assert text.strip()
def test_prompt_mentions_verbatim_behavior(self):
"""Prompt explicitly enforces verbatim transcription behavior."""
text = _prompt_text().lower()
assert "verbatim" in text
assert "do not summarize" in text
def test_prompt_includes_uncertainty_and_illegible_markers(self):
"""Prompt contains conventions for uncertainty and illegible text."""
text = _prompt_text().lower()
assert "[boston?]" in text
assert "[illegible]" in text
def test_prompt_includes_deleted_and_inserted_conventions(self):
"""Prompt contains conventions for deleted and inserted text."""
text = _prompt_text().lower()
assert "[deleted:" in text
assert "[inserted:" in text