23 lines
631 B
Python
23 lines
631 B
Python
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from corpus_mcp.database import build_database
|
|
|
|
|
|
@pytest.fixture
|
|
def corpus(tmp_path: Path) -> tuple[Path, Path]:
|
|
source = tmp_path / "source"
|
|
source.mkdir()
|
|
(source / "guide.md").write_text(
|
|
"# Search Guide\n\nThe quick brown fox explains full text search.",
|
|
encoding="utf-8",
|
|
)
|
|
(source / "notes.txt").write_text(
|
|
"A second document about SQLite indexing and retrieval.",
|
|
encoding="utf-8",
|
|
)
|
|
database = tmp_path / "corpus.sqlite"
|
|
build_database(source, database, description="Test documentation")
|
|
return source, database
|