From 4021fc16971c071f2ff597f9aacf63ce8ac13c2f Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Fri, 22 Mar 2024 17:34:54 -0400 Subject: [PATCH] x --- backend/server/extraction_runnable.py | 2 +- backend/tests/unit_tests/api/test_api_extract.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/server/extraction_runnable.py b/backend/server/extraction_runnable.py index 750941a..6493292 100644 --- a/backend/server/extraction_runnable.py +++ b/backend/server/extraction_runnable.py @@ -207,7 +207,7 @@ async def extract_entire_document( ] # Limit the number of chunks to process - if len(extraction_requests) < settings.MAX_CHUNKS: + if len(extraction_requests) > settings.MAX_CHUNKS and settings.MAX_CHUNKS > 0: content_too_long = True extraction_requests = extraction_requests[: settings.MAX_CHUNKS] else: diff --git a/backend/tests/unit_tests/api/test_api_extract.py b/backend/tests/unit_tests/api/test_api_extract.py index fcba237..3de7c75 100644 --- a/backend/tests/unit_tests/api/test_api_extract.py +++ b/backend/tests/unit_tests/api/test_api_extract.py @@ -200,6 +200,6 @@ async def test_extract_from_large_file() -> None: ) assert response.status_code == 200 assert response.json() == { - "data": ["a", "b"], - "content_too_long": False, + "data": ["a"], + "content_too_long": True, }