Skip to content

Commit

Permalink
fix sorting test (to add sources)
Browse files Browse the repository at this point in the history
  • Loading branch information
badGarnet committed Jan 22, 2025
1 parent 0b1f17d commit c96d431
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test_unstructured/partition/utils/test_sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def test_sort_text_regions():
[[1, 2, 2, 2], [1, 1, 2, 2], [3, 1, 4, 4]],
),
texts=np.array(["1", "2", "3"]),
sources=np.array(["foo"] * 3),
)
assert sort_text_regions(unsorted, sort_mode=SORT_MODE_BASIC).texts.tolist() == ["2", "3", "1"]

Expand All @@ -131,8 +132,9 @@ def test_sort_text_regions():
)
def test_sort_text_regions_with_invalid_coords_using_xy_cut_does_no_ops(coords):
unsorted = TextRegions(
element_coords=np.array(coords),
element_coords=np.array(coords).astype(float),
texts=np.array(["1", "2", "3"]),
sources=np.array(["foo"] * 3),
)
assert sort_text_regions(unsorted).texts.tolist() == ["1", "2", "3"]

Expand Down

0 comments on commit c96d431

Please sign in to comment.