🐛 fix cannot reject preset arg

This commit is contained in:
yanyongyu
2021-12-24 14:09:43 +08:00
parent 17f3c8fd09
commit 6643f951ef
4 changed files with 49 additions and 10 deletions

View File

@ -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)