From 5e160fc0321b39f40756d4945d3a29d037bd9e26 Mon Sep 17 00:00:00 2001 From: SWHL Date: Wed, 28 Aug 2024 22:09:38 +0800 Subject: [PATCH] test: Update unit testing --- tests/test_convert.py | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/tests/test_convert.py b/tests/test_convert.py index 9dee029..67cf7f1 100644 --- a/tests/test_convert.py +++ b/tests/test_convert.py @@ -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) @@ -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) @@ -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) @@ -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)