Skip to content

Commit

Permalink
🚨 auto fix by pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] authored and AzideCupric committed Oct 23, 2023
1 parent ddec634 commit 1bafa20
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nonebot_plugin_saa/adapters/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from . import qq as qq
from . import red as red
from . import feishu as feishu
from . import qqguild as qqguild
from . import kaiheila as kaiheila
from . import telegram as telegram
from . import onebot_v11 as onebot_v11
from . import onebot_v12 as onebot_v12
from . import qq as qq
1 change: 0 additions & 1 deletion nonebot_plugin_saa/auto_select_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ async def _(bot: Bot):
logger.info(f"refresh bot platform target cache {bot}")
async with BOT_CACHE_LOCK:
await _refresh_bot(bot)
print(BOT_CACHE)

@driver.on_bot_disconnect
async def _(bot: Bot):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_auto_select_qq_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,4 @@ async def test_send_auto_select(app: App, mocker: MockerFixture):
await AggregatedMessageFactory([Text("123"), Text("456")]).send_to(target)

# should connect back
adapter_qqguild.bot_connect(bot)
adapter_qqguild.bot_connect(bot)
2 changes: 1 addition & 1 deletion tests/test_qq.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,4 @@ def test_extract_target(app: App):
id="1",
author=User(id="1"),
)
assert extract_target(group_message_event) == TargetQQGuildChannel(channel_id=6677)
assert extract_target(group_message_event) == TargetQQGuildChannel(channel_id=6677)
4 changes: 3 additions & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
if TYPE_CHECKING:
from nonebug import App
from nonebot.internal.adapter.bot import Bot
from nonebot.adapters.qq import Message as QQMessage
from nonebot.adapters.telegram import Message as TGMessage
from nonebot.internal.adapter.message import MessageSegment
from nonebot.adapters.onebot.v11 import Message as OB11Message
from nonebot.adapters.onebot.v12 import Message as OB12Message
from nonebot.adapters.qqguild import Message as QQGuildMessage
from nonebot.adapters.qq import Message as QQMessage
from nonebot.adapters.telegram.event import MessageEvent as TGMessageEvent

from nonebot_plugin_saa.abstract_factories import (
Expand Down Expand Up @@ -199,6 +199,7 @@ def mock_qqguild_message_event(message: "QQGuildMessage", direct=False):
author=User(id=3344),
)


def mock_qq_message_event(message: "QQMessage", direct=False):
from nonebot.adapters.qq.models import User
from nonebot.adapters.qq.event import EventType
Expand All @@ -223,6 +224,7 @@ def mock_qq_message_event(message: "QQMessage", direct=False):
author=User(id="3344"),
)


def ob12_kwargs(platform="qq", impl="walle") -> Dict[str, Any]:
return {"platform": platform, "impl": impl}

Expand Down

0 comments on commit 1bafa20

Please sign in to comment.