mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-02-03 18:45:32 +08:00
* ⬆️ auto update by pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.13 → v0.12.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.13...v0.12.3) * 🚨 auto fix by pre-commit hooks * ⬆️ Upgrade dependency ruff to v0.12.4 * 🚨 修复 lint 警告 * 🚨 添加一个 noqa( --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: 呵呵です <51957264+shoucandanghehe@users.noreply.github.com> Co-authored-by: shoucandanghehe <wallfjjd@gmail.com>
20 lines
716 B
Python
20 lines
716 B
Python
import pytest
|
|
from nonebot.adapters.onebot.v11 import Message
|
|
from nonebug import App # type: ignore[import-untyped]
|
|
|
|
from tests.fake_event import FakeGroupMessageEvent
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_invalid_name(app: App) -> None:
|
|
from nonebot_plugin_tetris_stats.games import alc # noqa: PLC0415
|
|
|
|
raw_message = 'tstats tetrio bind 芜湖'
|
|
message = Message(raw_message)
|
|
event = FakeGroupMessageEvent(message=message, original_message=message, raw_message=raw_message)
|
|
async with app.test_matcher(alc) as ctx:
|
|
bot = ctx.create_bot()
|
|
ctx.receive_event(bot, event)
|
|
ctx.should_finished(alc)
|
|
ctx.should_call_send(event, '用户名/ID不合法', result=None)
|