Skip to content

Commit

Permalink
add cli test
Browse files Browse the repository at this point in the history
  • Loading branch information
quyuan committed Apr 29, 2024
1 parent d61cb49 commit 80ca01b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/test_cli/conf/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

}

12 changes: 9 additions & 3 deletions tests/test_cli/lib/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit 80ca01b

Please sign in to comment.