From 1e41f8453856cf1b5a2163c196a6814ef97e9f2e Mon Sep 17 00:00:00 2001 From: Kyomotoi Date: Mon, 14 Feb 2022 19:19:16 +0800 Subject: =?UTF-8?q?=F0=9F=9A=9A=20=E5=AF=B9=E6=8F=92=E4=BB=B6=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9B=B8=E5=85=B3=E8=BF=9B=E8=A1=8C=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test_plugin_applet.py | 28 ++++++++++++++++++++++++++++ test/test_plugin_rich.py | 28 ---------------------------- 2 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 test/test_plugin_applet.py delete mode 100644 test/test_plugin_rich.py (limited to 'test') diff --git a/test/test_plugin_applet.py b/test/test_plugin_applet.py new file mode 100644 index 0000000..d2c0654 --- /dev/null +++ b/test/test_plugin_applet.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.applet 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, + ) diff --git a/test/test_plugin_rich.py b/test/test_plugin_rich.py deleted file mode 100644 index 3e63f4a..0000000 --- a/test/test_plugin_rich.py +++ /dev/null @@ -1,28 +0,0 @@ -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