Skip to content

Commit

Permalink
🎨 fix version 0.45.1
Browse files Browse the repository at this point in the history
  • Loading branch information
RF-Tar-Railt committed May 1, 2024
1 parent 972b6a1 commit 605c742
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
test:
strategy:
matrix:
py_ver: [3.9', '3.10', '3.11', '3.12']
py_ver: ['3.9', '3.10', '3.11', '3.12']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion src/nonebot_plugin_alconna/matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

from .rule import alconna
from .typings import MReturn
from .util import annotation
from .model import CompConfig
from .pattern import patterns
from .uniseg import Text, Segment, UniMessage
Expand All @@ -63,7 +64,6 @@
_Dispatch,
merge_path,
)
from .util import annotation

_M = Union[str, Message, MessageSegment, MessageTemplate, Segment, UniMessage, UniMessageTemplate]

Expand Down
3 changes: 2 additions & 1 deletion src/nonebot_plugin_alconna/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Callable, TypeVar
from typing import TypeVar, Callable

TCallable = TypeVar("TCallable", bound=Callable)

Expand All @@ -7,4 +7,5 @@ def annotation(**types):
def wrapper(func: TCallable) -> TCallable:
func.__annotations__ = types
return func

return wrapper
4 changes: 2 additions & 2 deletions tests/test_gotpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ async def tt(target: Union[str, At]):
event = fake_group_message_event_v11(message=Message("1234"), user_id=123)
ctx.receive_event(bot, event)
ctx.should_call_send(event, Message("ok\n1234"))

event = fake_group_message_event_v11(message=Message("test_got"), user_id=123)
ctx.receive_event(bot, event)
ctx.should_call_send(event, "请输入目标", result=None)
ctx.should_rejected(test_cmd)
event = fake_group_message_event_v11(message=Message(MessageSegment.at(1234)), user_id=123)
ctx.receive_event(bot, event)
ctx.should_call_send(event, Message([MessageSegment.text("ok\n"), MessageSegment.at(1234)]))

event = fake_group_message_event_v11(message=Message("test_got 1234"), user_id=123)
ctx.receive_event(bot, event)
ctx.should_call_send(event, Message("ok\n1234"))

0 comments on commit 605c742

Please sign in to comment.