✅ 添加测试:更新与添加插件 (#1594)

* ✅ 测试更新与添加插件

* ✅ Sourcery建议

* 👷 添加pytest

* 🎨 优化代码
This commit is contained in:
AkashiCoin
2024-09-01 14:53:41 +08:00
committed by GitHub
parent a3681216bd
commit 7e7436f433
16 changed files with 624 additions and 17 deletions
@@ -117,14 +117,14 @@ def _file_handle(latest_version: str | None):
shutil.move(src_folder_path, dest_folder_path)
else:
logger.debug(f"源文件夹不存在: {src_folder_path}", "检查更新")
if tf:
tf.close()
if download_file.exists():
logger.debug(f"删除下载文件: {download_file}", "检查更新")
download_file.unlink()
if extract_path.exists():
logger.debug(f"删除解压文件夹: {extract_path}", "检查更新")
shutil.rmtree(extract_path)
if tf:
tf.close()
if TMP_PATH.exists():
shutil.rmtree(TMP_PATH)
if latest_version: