重构插件商店更新逻辑&彻底修复工作流 (#1782)

* 修复bot-check工作流

* Update bot_check.yml

* 修复依赖问题

* 修复戳一戳自检鉴权

* 🚨 auto fix by pre-commit hooks

* 优化工作流执行顺序

* 更新插件测试

* 更新插件商店

* 🚨 auto fix by pre-commit hooks

* Update bot_check.yml

* Update bot_check.yml

* Update bot_check.yml

* 请求 @ThelevenFD 修复测试

* 🚨 auto fix by pre-commit hooks

* Update zhenxun/builtin_plugins/plugin_store/data_source.py

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

* 修复代码过长的问题

* 🚨 auto fix by pre-commit hooks

* 同步check.py

* Update test_check.py

* 🚨 auto fix by pre-commit hooks

---------

Co-authored-by: ThelevenFD <104363913+ThelevenFD@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
This commit is contained in:
molanp
2024-12-19 09:15:39 +08:00
committed by GitHub
co-authored by sourcery-ai[bot] ThelevenFD pre-commit-ci[bot]
parent ccf043d670
commit a15303a891
4 changed files with 59 additions and 37 deletions
+4 -4
View File
@@ -67,7 +67,7 @@ async def test_check(
"""
测试自检
"""
from zhenxun.builtin_plugins.check import _matcher
from zhenxun.builtin_plugins.check import _self_check_matcher
from zhenxun.builtin_plugins.check.data_source import __get_version
from zhenxun.configs.config import BotConfig
@@ -81,7 +81,7 @@ async def test_check(
mock_build_message_return,
mock_template_path_new,
) = init_mocker(mocker, tmp_path)
async with app.test_matcher(_matcher) as ctx:
async with app.test_matcher(_self_check_matcher) as ctx:
bot = create_bot(ctx)
bot: Bot = cast(Bot, bot)
raw_message = "自检"
@@ -137,7 +137,7 @@ async def test_check_arm(
"""
测试自检(arm)
"""
from zhenxun.builtin_plugins.check import _matcher
from zhenxun.builtin_plugins.check import _self_check_matcher
from zhenxun.builtin_plugins.check.data_source import __get_version
from zhenxun.configs.config import BotConfig
@@ -171,7 +171,7 @@ async def test_check_arm(
mock_cpuinfo.get_cpu_info.return_value = {}
mock_psutil.cpu_freq.return_value = {}
async with app.test_matcher(_matcher) as ctx:
async with app.test_matcher(_self_check_matcher) as ctx:
bot = create_bot(ctx)
bot: Bot = cast(Bot, bot)
raw_message = "自检"
@@ -57,7 +57,9 @@ async def test_update_all_plugin_basic_need_update(
)
ctx.should_call_send(
event=event,
message=Message(message="已更新插件 识图\n共计1个插件! 重启后生效"),
message=Message(
message="--已更新1个插件 0个失败 1个成功--\n* 以下插件更新成功:\n\t- 识图\n重启后生效" # noqa: E501
),
result=None,
bot=bot,
)