mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-06 04:10:02 +08:00
Fix/test_runwork (#2001)
* fix(test): 修复测试工作流 - 修改自动更新模块中的导入路径 - 更新插件商店模块中的插件信息获取逻辑 - 优化插件添加、更新和移除流程 - 统一插件相关错误信息的格式 - 调整测试用例以适应新的插件管理逻辑 * test(builtin_plugins): 重构插件商店相关测试 - 移除 jsd 相关测试用例,只保留 gh(GitHub)的测试 - 删除了 test_plugin_store.py 文件,清理了插件商店的测试 - 更新了 test_search_plugin.py 中的插件版本号 - 调整了 test_update_plugin.py 中的已加载插件版本 - 移除了 StoreManager 类中的 is_external 变量 - 更新了 RepoFileManager 类中的文件获取逻辑,优先使用 GitHub
This commit is contained in:
@@ -207,13 +207,13 @@ class RepoFileManager:
|
||||
)
|
||||
if repo_type is None:
|
||||
try:
|
||||
return await self.get_aliyun_file_content(
|
||||
repo_name, file_path, branch, ignore_error
|
||||
)
|
||||
except Exception:
|
||||
return await self.get_github_file_content(
|
||||
repo_url, file_path, ignore_error
|
||||
)
|
||||
except Exception:
|
||||
return await self.get_aliyun_file_content(
|
||||
repo_name, file_path, branch, ignore_error
|
||||
)
|
||||
|
||||
try:
|
||||
if repo_type == RepoType.GITHUB:
|
||||
@@ -257,17 +257,17 @@ class RepoFileManager:
|
||||
)
|
||||
try:
|
||||
if repo_type is None:
|
||||
# 尝试阿里云,失败则尝试GitHub
|
||||
# 尝试GitHub,失败则尝试阿里云
|
||||
try:
|
||||
return await self._list_aliyun_directory_files(
|
||||
repo_name, directory_path, branch, recursive
|
||||
return await self._list_github_directory_files(
|
||||
repo_url, directory_path, branch, recursive
|
||||
)
|
||||
except Exception as e:
|
||||
logger.warning(
|
||||
"获取阿里云目录文件失败,尝试GitHub", LOG_COMMAND, e=e
|
||||
"获取GitHub目录文件失败,尝试阿里云", LOG_COMMAND, e=e
|
||||
)
|
||||
return await self._list_github_directory_files(
|
||||
repo_url, directory_path, branch, recursive
|
||||
return await self._list_aliyun_directory_files(
|
||||
repo_name, directory_path, branch, recursive
|
||||
)
|
||||
if repo_type == RepoType.GITHUB:
|
||||
return await self._list_github_directory_files(
|
||||
@@ -526,6 +526,7 @@ class RepoFileManager:
|
||||
content_bytes = content.encode("utf-8")
|
||||
else:
|
||||
content_bytes = content
|
||||
logger.warning(f"写入文件: {local_path}")
|
||||
async with aiofiles.open(local_path, "wb") as f:
|
||||
await f.write(content_bytes)
|
||||
result.success = True
|
||||
|
||||
Reference in New Issue
Block a user