Enhance README with detailed service description, setup instructions, and example .env configuration for the FastAPI service that integrates with Paperless-ngx and llama.cpp for PDF processing.
This commit is contained in:
28
tests/test_paperless_task_parse.py
Normal file
28
tests/test_paperless_task_parse.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from notebook_tools.paperless_client import _document_id_from_task_payload
|
||||
|
||||
|
||||
def test_related_document_string() -> None:
|
||||
assert (
|
||||
_document_id_from_task_payload(
|
||||
{
|
||||
"related_document": "10",
|
||||
"result": "Success. New document id 10 created",
|
||||
}
|
||||
)
|
||||
== 10
|
||||
)
|
||||
|
||||
|
||||
def test_result_string_only() -> None:
|
||||
assert (
|
||||
_document_id_from_task_payload(
|
||||
{"related_document": None, "result": "Success. New document id 42 created"}
|
||||
)
|
||||
== 42
|
||||
)
|
||||
|
||||
|
||||
def test_related_document_int() -> None:
|
||||
assert _document_id_from_task_payload({"related_document": 7}) == 7
|
||||
Reference in New Issue
Block a user