Skip to content

Commit

Permalink
test: update unit tests for different platform
Browse files Browse the repository at this point in the history
  • Loading branch information
SWHL committed Nov 19, 2024
1 parent df36c69 commit 030b17b
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions python/tests/test_ort.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from rapidocr_onnxruntime import LoadImageError, RapidOCR

from .base_module import Platform, download_file
from .base_module import download_file

engine = RapidOCR()
tests_dir = root_dir / "tests" / "test_files"
Expand All @@ -30,11 +30,9 @@ def test_long_img():
img_path = tests_dir / "long.jpeg"
download_file(img_url, save_path=img_path)
result, _ = engine(img_path)

assert result is not None
if cur_platform == Platform.mac:
assert len(result) == 53
elif cur_platform == Platform.linux:
assert len(result) == 55
assert len(result) >= 55

img_path.unlink()

Expand Down Expand Up @@ -226,12 +224,7 @@ def test_input_three_ndim_one_channel():

result, _ = engine(img)

if cur_platform == Platform.mac:
assert len(result) == 17
else:
assert result is not None
assert result[0][1] == "正品促销"
assert len(result) == 17
assert len(result) >= 17


@pytest.mark.parametrize(
Expand Down

0 comments on commit 030b17b

Please sign in to comment.