Skip to content

Commit 0e72b67

Browse files
test: extract_image_block_types parameter usage (#372)
This PR updates the unit test function to test if image metadata `image_base64` and `image_mime_type` are present when `extract_image_block_types` parameter is given.
1 parent d0a7f9c commit 0e72b67

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test_general/api/test_app.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,14 @@ def test_include_page_breaks_param():
381381
assert response_without_page_breaks[-1]["type"] != "PageBreak"
382382

383383

384-
def test_include_extract_image_block_types_param():
384+
@pytest.mark.parametrize(
385+
"extract_image_block_types",
386+
[
387+
'["Image", "Table"]',
388+
["Image", "Table"],
389+
],
390+
)
391+
def test_include_extract_image_block_types_param(extract_image_block_types):
385392
"""
386393
Verify that responses do not include base64 image in Table/Image metadata unless requested.
387394
"""
@@ -401,7 +408,7 @@ def test_include_extract_image_block_types_param():
401408
response = client.post(
402409
MAIN_API_ROUTE,
403410
files=[("files", (str(test_file), file))],
404-
data={"strategy": "hi_res", "extract_image_block_types": '["Image", "Table"]'},
411+
data={"strategy": "hi_res", "extract_image_block_types": extract_image_block_types},
405412
)
406413

407414
assert response.status_code == 200

0 commit comments

Comments
 (0)