common.py 463 B

12345678910111213141516171819202122
  1. import subprocess
  2. import os
  3. def check_shell(cmd):
  4. """
  5. shell successful
  6. """
  7. res = os.system(cmd)
  8. assert res == 0
  9. def count_folders_and_check_contents(file_path):
  10. """"
  11. 获取文件夹大小
  12. """
  13. if os.path.exists(file_path):
  14. folder_count = os.path.getsize(file_path)
  15. assert folder_count > 0
  16. if __name__ == "__main__":
  17. count_folders_and_check_contents("/home/quyuan/code/Magic-PDF/Magic-PDF/Magic-PDF/ci")