Some checks failed
Smoke Test / smoke (push) Has been cancelled
Merge PR #638
73 lines
2.6 KiB
Python
73 lines
2.6 KiB
Python
"""Tests for Big Brain Testament rewrite artifact."""
|
|
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture
|
|
def artifact_path():
|
|
return Path(__file__).parent.parent.parent / "docs" / "big-brain-testament-draft.md"
|
|
|
|
|
|
class TestArtifactExists:
|
|
def test_file_exists(self, artifact_path):
|
|
assert artifact_path.exists()
|
|
|
|
def test_not_empty(self, artifact_path):
|
|
content = artifact_path.read_text()
|
|
assert len(content) > 1000
|
|
|
|
|
|
class TestArtifactStructure:
|
|
def test_has_original_passage(self, artifact_path):
|
|
content = artifact_path.read_text()
|
|
assert "Original Passage" in content
|
|
assert "rain didn't fall" in content
|
|
assert "Jefferson Street Overpass" in content
|
|
|
|
def test_has_rewrite(self, artifact_path):
|
|
content = artifact_path.read_text()
|
|
assert "Rewrite" in content
|
|
assert "surrendered" in content.lower() or "surrendered" in content
|
|
|
|
def test_has_comparison(self, artifact_path):
|
|
content = artifact_path.read_text()
|
|
assert "Comparison" in content
|
|
assert "Original:" in content
|
|
assert "Rewrite:" in content
|
|
assert "Delta:" in content
|
|
|
|
def test_has_compression_stats(self, artifact_path):
|
|
content = artifact_path.read_text()
|
|
assert "Compression" in content or "Stats" in content
|
|
assert "119" in content or "100" in content
|
|
|
|
def test_has_testament_principle(self, artifact_path):
|
|
content = artifact_path.read_text()
|
|
assert "Testament Principle" in content
|
|
assert "don't make longer" in content or "Mastery through iteration" in content
|
|
|
|
def test_has_big_brain_placeholder(self, artifact_path):
|
|
content = artifact_path.read_text()
|
|
assert "Big Brain" in content
|
|
|
|
def test_references_issue(self, artifact_path):
|
|
content = artifact_path.read_text()
|
|
assert "578" in content
|
|
|
|
|
|
class TestRewriteQuality:
|
|
def test_rewrite_is_shorter(self, artifact_path):
|
|
content = artifact_path.read_text()
|
|
# The comparison table should show the rewrite is shorter
|
|
assert "-16%" in content or "shorter" in content.lower() or "100" in content
|
|
|
|
def test_rewrite_preserves_key_images(self, artifact_path):
|
|
content = artifact_path.read_text()
|
|
rewrite_section = content.split("Rewrite: Timmy Draft")[1].split("---")[0] if "Rewrite: Timmy Draft" in content else ""
|
|
assert "rain" in rewrite_section.lower()
|
|
assert "bridge" in rewrite_section.lower()
|
|
assert "grief" in rewrite_section.lower()
|
|
assert "gravity" in rewrite_section.lower()
|