mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-14 02:42:22 +02:00
Squash Odysseus development history
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
from pathlib import Path
|
||||
|
||||
from src import personal_docs
|
||||
|
||||
|
||||
def test_personal_index_includes_office_uploads(tmp_path, monkeypatch):
|
||||
docx_path = tmp_path / "report.docx"
|
||||
docx_path.write_bytes(b"PK fake docx bytes")
|
||||
|
||||
monkeypatch.setattr(
|
||||
personal_docs,
|
||||
"extract_office_text",
|
||||
lambda path: "# Report\n\nreadable office text" if Path(path) == docx_path else "",
|
||||
)
|
||||
|
||||
files = personal_docs.load_personal_index(str(tmp_path))
|
||||
|
||||
assert [item["name"] for item in files] == ["report.docx"]
|
||||
assert files[0]["path"] == str(docx_path)
|
||||
assert files[0]["chunks"] == ["# Report\n\nreadable office text"]
|
||||
|
||||
|
||||
def test_personal_index_default_extensions_advertise_office_support():
|
||||
for ext in (".docx", ".pptx", ".xlsx", ".xls"):
|
||||
assert ext in personal_docs.config.DEFAULT_EXTENSIONS
|
||||
Reference in New Issue
Block a user