43 lines
1.4 KiB
Python
43 lines
1.4 KiB
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from personal_mcp.registry.ingest.document import MarkdownDocument
|
|
from personal_mcp.registry.ingest.prompt import PromptFilesBundle
|
|
from personal_mcp.registry.ingest.skill import SkillFilesBundle
|
|
|
|
pytestmark = pytest.mark.unit
|
|
|
|
REPO_ROOT = Path(__file__).parents[3]
|
|
DOCS_ROOT = REPO_ROOT / "docs"
|
|
|
|
|
|
class TestCurrentDocsIngestion:
|
|
"""Covers ingestion of the repository's current docs tree."""
|
|
|
|
def test_loads_markdown_documents(self) -> None:
|
|
"""Ensures all current markdown documents can be loaded."""
|
|
docs = MarkdownDocument.from_root(DOCS_ROOT)
|
|
|
|
assert docs
|
|
|
|
def test_bundles_current_skills(self) -> None:
|
|
"""Ensures all current canonical skill documents can be bundled."""
|
|
docs = MarkdownDocument.from_root(DOCS_ROOT)
|
|
expected_slugs = {path.parent.name for path in DOCS_ROOT.glob("skills/*/SKILL.md")}
|
|
|
|
bundles = SkillFilesBundle.from_docs(docs.values())
|
|
|
|
assert {bundle.slug for bundle in bundles} == expected_slugs
|
|
|
|
def test_bundles_current_prompts(self) -> None:
|
|
"""Ensures all current canonical prompt documents can be bundled."""
|
|
docs = MarkdownDocument.from_root(DOCS_ROOT)
|
|
expected_slugs = {path.parent.name for path in DOCS_ROOT.glob("prompts/*/PROMPT.md")}
|
|
|
|
bundles = PromptFilesBundle.from_docs(docs.values())
|
|
|
|
assert {bundle.slug for bundle in bundles} == expected_slugs
|