init commit
This commit is contained in:
15
pdf_server/test_pdf.py
Normal file
15
pdf_server/test_pdf.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import asyncio
|
||||
import os
|
||||
from pdf import translate_pdf
|
||||
|
||||
def test_translate_pdf():
|
||||
test_pdf_path = os.path.abspath("/Users/mengxin/Project/mcp-client/测试文档.pdf")
|
||||
if not os.path.exists(test_pdf_path):
|
||||
print("测试PDF文件不存在,请放置测试文档.pdf 在当前目录下。")
|
||||
return
|
||||
result = asyncio.run(translate_pdf(test_pdf_path))
|
||||
print("翻译结果:\n", result)
|
||||
assert "翻译失败" not in result and "PDF解析失败" not in result, "翻译或解析失败"
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_translate_pdf()
|
Reference in New Issue
Block a user