diff --git a/nonebot/consts.py b/nonebot/consts.py index 2b7a88fe9050..0cf4056fe06f 100644 --- a/nonebot/consts.py +++ b/nonebot/consts.py @@ -22,7 +22,7 @@ """当前 `reject` 目标存储 key""" REJECT_CACHE_TARGET: Literal["_next_target"] = "_next_target" """下一个 `reject` 目标存储 key""" -PAUSE_PROMPT_RESULT_KEY: Literal["_pause_{key}_result"] = "_pause_{key}_result" +PAUSE_PROMPT_RESULT_KEY: Literal["_pause_result"] = "_pause_result" """`pause` prompt 发送结果存储 key""" REJECT_PROMPT_RESULT_KEY: Literal["_reject_{key}_result"] = "_reject_{key}_result" """`reject` prompt 发送结果存储 key""" diff --git a/tests/test_param.py b/tests/test_param.py index 1e1bab62be31..bf561c9ecb87 100644 --- a/tests/test_param.py +++ b/tests/test_param.py @@ -560,7 +560,7 @@ async def test_matcher(app: App): async with app.test_api() as ctx: bot = ctx.create_bot() - ctx.should_call_send(event, "test", result=True, bot=bot) + ctx.should_call_send(event, "test", result=False, bot=bot) with fake_matcher.ensure_context(bot, event): fake_matcher.set_target("test") with suppress(PausedException): @@ -570,7 +570,7 @@ async def test_matcher(app: App): pause_prompt_result, allow_types=[MatcherParam, DependParam] ) as ctx: ctx.pass_params(matcher=fake_matcher) - ctx.should_return(True) + ctx.should_return(False) @pytest.mark.anyio @@ -622,7 +622,7 @@ async def test_arg(app: App): async with app.test_api() as ctx: bot = ctx.create_bot() - ctx.should_call_send(event, "test", result=True, bot=bot) + ctx.should_call_send(event, "test", result="arg", bot=bot) with matcher.ensure_context(bot, event): with suppress(RejectedException): await matcher.reject("test") @@ -631,7 +631,7 @@ async def test_arg(app: App): annotated_arg_prompt_result, allow_types=[ArgParam] ) as ctx: ctx.pass_params(matcher=matcher) - ctx.should_return(True) + ctx.should_return("arg") async with app.test_dependent(annotated_multi_arg, allow_types=[ArgParam]) as ctx: ctx.pass_params(matcher=matcher)