Commit 0a72b97d authored by 赵小蒙's avatar 赵小蒙

Merge remote-tracking branch 'origin/master'

parents 84bc6520 e25a8499
...@@ -2,7 +2,7 @@ import os ...@@ -2,7 +2,7 @@ import os
conf = { conf = {
"code_path": os.environ.get('GITHUB_WORKSPACE'), "code_path": os.environ.get('GITHUB_WORKSPACE'),
"pdf_dev_path" : os.environ.get('GITHUB_WORKSPACE') + "/tests/test_cli/pdf_dev", "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"
} }
import subprocess import subprocess
import os
def check_shell(cmd): def check_shell(cmd):
res = subprocess.check_output(cmd, shell=True) res = os.system(cmd)
assert res == 0 assert res == 0
def count_folders_and_check_contents(directory): def count_folders_and_check_contents(directory):
...@@ -10,8 +11,14 @@ def count_folders_and_check_contents(directory): ...@@ -10,8 +11,14 @@ def count_folders_and_check_contents(directory):
for item in contents: for item in contents:
# 检查是否为文件夹 # 检查是否为文件夹
if os.path.isdir(os.path.join(directory, item)): if os.path.isdir(os.path.join(directory, item)):
folder_count += 1
# 检查文件夹是否为空 # 检查文件夹是否为空
folder_path = os.path.join(directory, item) folder_path = os.path.join(directory, item)
for folder in os.listdir(folder_path):
folder_count = folder_count + 1
assert os.listdir(folder_path) is not None assert os.listdir(folder_path) is not None
assert folder_count == 3 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
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment