Skip to content

Commit

Permalink
✏️ improve
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyongyu authored Dec 5, 2024
1 parent 27cca30 commit 9f997bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nonebot/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down
8 changes: 4 additions & 4 deletions tests/test_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand Down Expand Up @@ -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")
Expand All @@ -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)
Expand Down

0 comments on commit 9f997bf

Please sign in to comment.