Skip to content

Commit 65e4341

Browse files
committed
Update tests
1 parent 8b4d716 commit 65e4341

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

image_processing/tests/image_processing/test_layout_analysis.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
LayoutAnalysis,
1313
)
1414

15+
1516
# --- Dummy classes to simulate ADI results and figures ---
17+
class DummySpan:
18+
def __init__(self, offset, length):
19+
self.offset = offset
20+
self.length = length
1621

1722

1823
class DummyPage:
@@ -37,7 +42,7 @@ def __init__(self, id, offset, length, page_number, caption_content):
3742
self.id = id # note: process_figures_from_extracted_content checks "if figure.id is None"
3843
self.bounding_regions = [DummyRegion(page_number)]
3944
self.caption = DummyCaption(caption_content)
40-
self.spans = [{"offset": offset, "length": length}]
45+
self.spans = [DummySpan(offset, length)]
4146

4247

4348
class DummyResult:
@@ -237,10 +242,7 @@ async def dummy_analyse_document(file_path):
237242
# The data field should contain the base64-encoded image.
238243
expected_b64 = base64.b64encode(b"fake_image").decode("utf-8")
239244
assert figure_data["data"] == expected_b64
240-
# Verify that the container, blob, and caption are set as expected.
241-
assert figure_data["container"] == f"{la.container}-figures"
242-
expected_blob = f"{la.blob}/fig1.png"
243-
assert figure_data["blob"] == expected_blob
245+
# Verify that the caption are set as expected.
244246
assert figure_data["caption"] == "Caption text"
245247
assert result["errors"] is None
246248

0 commit comments

Comments
 (0)