migration
This commit is contained in:
@@ -1,32 +1,21 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
from pathlib import PurePosixPath
|
||||
|
||||
import pytest
|
||||
|
||||
from personal_mcp.registry.ingest.document import MarkdownDocument
|
||||
from personal_mcp.registry.ingest.prompt import PromptFilesBundle
|
||||
from personal_mcp.registry.load import get_docs_registry
|
||||
|
||||
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)
|
||||
def test_registry_includes_docs_and_excludes_skills(self) -> None:
|
||||
"""Ensures the docs registry cannot duplicate native skill resources."""
|
||||
registry = get_docs_registry()
|
||||
|
||||
assert docs
|
||||
|
||||
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
|
||||
assert PurePosixPath("index.md") in registry.docs_markdown_by_path
|
||||
assert any(path.parts[0] == "prompts" for path in registry.docs_markdown_by_path)
|
||||
assert all(path.parts[0] != "skills" for path in registry.docs_markdown_by_path)
|
||||
|
||||
Reference in New Issue
Block a user