From 80ca01bdd1d6e737df405cefb67777852d3100cf Mon Sep 17 00:00:00 2001 From: quyuan Date: Mon, 29 Apr 2024 11:51:56 +0800 Subject: [PATCH] add cli test --- tests/test_cli/conf/conf.py | 2 +- tests/test_cli/lib/common.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/test_cli/conf/conf.py b/tests/test_cli/conf/conf.py index 57a30a72..573c7c5c 100644 --- a/tests/test_cli/conf/conf.py +++ b/tests/test_cli/conf/conf.py @@ -2,7 +2,7 @@ conf = { "code_path": os.environ.get('GITHUB_WORKSPACE'), "pdf_dev_path" : os.environ.get('GITHUB_WORKSPACE') + "/tests/test_cli/pdf_dev", -"pdf_res_path": "/home/quyuan/code/Magic-PDF/Magic-PDF/Magic-PDF/data" +"pdf_res_path": "/home/quyuan/code/Magic-PDF/Magic-PDF/Magic-PDF/ci" } diff --git a/tests/test_cli/lib/common.py b/tests/test_cli/lib/common.py index 34f82f9f..a4a2f481 100644 --- a/tests/test_cli/lib/common.py +++ b/tests/test_cli/lib/common.py @@ -11,8 +11,14 @@ def count_folders_and_check_contents(directory): for item in contents: # 检查是否为文件夹 if os.path.isdir(os.path.join(directory, item)): - folder_count += 1 # 检查文件夹是否为空 folder_path = os.path.join(directory, item) - assert os.listdir(folder_path) is not None - assert folder_count == 3 + for folder in os.listdir(folder_path): + folder_count = folder_count + 1 + assert os.listdir(folder_path) is not None + print (folder_count) + assert folder_count == 13 + + +if __name__ == "__main__": + count_folders_and_check_contents("/home/quyuan/code/Magic-PDF/Magic-PDF/Magic-PDF/ci") \ No newline at end of file