mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 16:21:28 +00:00
🐛 fix cannot reject preset arg
This commit is contained in:
@ -9,6 +9,7 @@ async def test_matcher(app: App, load_plugin):
|
||||
from plugins.matcher import (
|
||||
test_got,
|
||||
test_handle,
|
||||
test_preset,
|
||||
test_combine,
|
||||
test_receive,
|
||||
)
|
||||
@ -58,3 +59,10 @@ async def test_matcher(app: App, load_plugin):
|
||||
ctx.receive_event(bot, event_next)
|
||||
ctx.should_rejected()
|
||||
ctx.receive_event(bot, event_next)
|
||||
|
||||
assert len(test_preset.handlers) == 2
|
||||
async with app.test_matcher(test_preset) as ctx:
|
||||
bot = ctx.create_bot()
|
||||
ctx.receive_event(bot, event)
|
||||
ctx.should_rejected()
|
||||
ctx.receive_event(bot, event_next)
|
||||
|
Reference in New Issue
Block a user