Import project files
This commit is contained in:
17
docling/tests/debug_api.py
Normal file
17
docling/tests/debug_api.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
root = Path(__file__).resolve().parents[2] / "docling"
|
||||
sys.path.insert(0, str(root))
|
||||
import app.server as server
|
||||
|
||||
from docling.tests.test_api_prd import setup_module, PNG
|
||||
setup_module()
|
||||
|
||||
app = server.app
|
||||
c = TestClient(app)
|
||||
files = {"file": ("管理端使用说明 (1).pdf", b"%PDF-1.4\n")}
|
||||
data = {"export": "markdown", "save": "true", "filename": "管理端使用说明 (1)"}
|
||||
r = c.post("/api/convert", files=files, data=data)
|
||||
print(r.json())
|
||||
Reference in New Issue
Block a user