From 3e32ca3964ff8f40e0b491e87f153040f2348fd0 Mon Sep 17 00:00:00 2001 From: Kyomotoi Date: Thu, 3 Feb 2022 14:36:24 +0800 Subject: =?UTF-8?q?=F0=9F=94=96=20=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新记录请参考文档: atri.kyomotoi.moe/changelog/overview/ --- test/test_plugin_rich.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/test_plugin_rich.py (limited to 'test/test_plugin_rich.py') diff --git a/test/test_plugin_rich.py b/test/test_plugin_rich.py new file mode 100644 index 0000000..3e63f4a --- /dev/null +++ b/test/test_plugin_rich.py @@ -0,0 +1,28 @@ +import pytest +from nonebug import App + +from .utils import make_fake_message, make_fake_event + + +@pytest.mark.asyncio +async def test_bili_rich(app: App): + from ATRI.plugins.rich import bili_rich + + Message = make_fake_message() + + async with app.test_matcher(bili_rich) as ctx: + bot = ctx.create_bot() + + msg = Message("BV1Ff4y1C7YR") + event = make_fake_event(_message=msg)() + + ctx.receive_event(bot, event) + ctx.should_call_send( + event, + """ + BV1Ff4y1C7YR INFO: + Title: 【8K30fps】这可能是画质最高的Rick Roll (doge) + Link: https://b23.tv/BV1Ff4y1C7YR + """, + True, + ) -- cgit v1.2.3