From 7ce69fb6f81ca454ce9eec6ec01005e7535e18a3 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sat, 7 Nov 2020 18:15:09 +0800 Subject: [PATCH] :white_check_mark: add processor test --- tests/test_plugins/test_processor.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/test_plugins/test_processor.py diff --git a/tests/test_plugins/test_processor.py b/tests/test_plugins/test_processor.py new file mode 100644 index 00000000..8352dbdb --- /dev/null +++ b/tests/test_plugins/test_processor.py @@ -0,0 +1,13 @@ +from nonebot.typing import Bot, Event, Matcher +from nonebot.message import event_preprocessor, run_preprocessor + + +@event_preprocessor +async def handle(bot: Bot, event: Event, state: dict): + state["preprocessed"] = True + print(event) + + +@run_preprocessor +async def run(matcher: Matcher, bot: Bot, event: Event, state: dict): + print(matcher)