test: .doc заглушка — актуальный формат ошибки сервиса; docs: итоги v0.0.32
Deploy drhider / validate (push) Canceled after 0s

This commit is contained in:
“Naeel”
2026-08-18 23:08:43 +04:00
parent 94e588aaba
commit 0ad5a5fabd
2 changed files with 87 additions and 2 deletions
+3 -2
View File
@@ -39,9 +39,10 @@ check(".txt — текст извлечён", text == "Просто текст")
text = extract_text("документ.txt", "Привет мир".encode("utf-8"))
check(".txt — кириллица", "Привет" in text)
# 3. .doc (бинарный — пропускается)
# 3. .doc (бинарный — не конвертируется, возвращается заглушка об ошибке)
# Мусорный OLE2-магик: сервис liberta не может сконвертировать → заглушка "[DOC ...]"
text = extract_text("старый.doc", b"\xD0\xCF\x11\xE0\x00" * 10)
check(".doc — заглушка", "not supported" in text.lower() or "binary" in text.lower())
check(".doc — заглушка", text.startswith("[DOC") or "not supported" in text.lower())
# 4. Неизвестное расширение → UTF-8
text = extract_text("file.xyz", "hello".encode("utf-8"))