Skip to content

Commit

Permalink
test: Update unit testing
Browse files Browse the repository at this point in the history
  • Loading branch information
SWHL committed Aug 28, 2024
1 parent 13a7933 commit 5e160fc
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions tests/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ def is_windows():
def test_url_input():
url = "https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar"
onnx_path = converter(url, save_dir, is_del_raw=True)
md5_value = get_md5(onnx_path)
if is_windows():
assert md5_value == "877a502cf1c4817e8eb50d847f35dd6f"
else:
assert md5_value == "67ffba91f570b15f15ef2b9da9505e0b"
assert Path(onnx_path).exists()
shutil.rmtree(save_dir)


Expand All @@ -46,11 +42,7 @@ def test_local_input():
tar_path = download_file(url, save_dir)
onnx_path = converter(tar_path, save_dir, is_del_raw=True)

md5_value = get_md5(onnx_path)
if is_windows():
assert md5_value == "877a502cf1c4817e8eb50d847f35dd6f"
else:
assert md5_value == "67ffba91f570b15f15ef2b9da9505e0b"
assert Path(onnx_path).exists()

shutil.rmtree(save_dir)

Expand All @@ -59,12 +51,9 @@ def test_rec_input():
url = "https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar"
txt_url = "https://gitee.com/paddlepaddle/PaddleOCR/raw/release/2.6/ppocr/utils/ppocr_keys_v1.txt"
onnx_path = converter(url, save_dir, txt_path=txt_url, is_del_raw=True)
md5_value = get_md5(onnx_path)

if is_windows():
assert md5_value == "e40e359fd082498ed30abf80223e8e05"
else:
assert md5_value == "0ba3af0828db6faa400612cf1b000965"
assert Path(onnx_path).exists()

shutil.rmtree(save_dir)


Expand All @@ -75,11 +64,7 @@ def test_rec_input_local():
txt_path = download_file(txt_url, save_dir)

onnx_path = converter(tar_path, save_dir, txt_path=txt_path, is_del_raw=True)
md5_value = get_md5(onnx_path)

if is_windows():
assert md5_value == "e40e359fd082498ed30abf80223e8e05"
else:
assert md5_value == "0ba3af0828db6faa400612cf1b000965"
assert Path(onnx_path).exists()

shutil.rmtree(save_dir)

0 comments on commit 5e160fc

Please sign in to comment.