mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 10:11:52 +00:00
Fix not all args are passed to handler function invocation (#633)
This commit is contained in:
parent
125fc22ff9
commit
4599913e18
2 changed files with 17 additions and 1 deletions
|
|
@ -22,6 +22,10 @@ async def callback3(foo: int, **kwargs):
|
|||
return locals()
|
||||
|
||||
|
||||
async def callback4(foo: int, *, bar: int, baz: int):
|
||||
return locals()
|
||||
|
||||
|
||||
class Filter(BaseFilter):
|
||||
async def __call__(self, foo: int, bar: int, baz: int) -> Union[bool, Dict[str, Any]]:
|
||||
return locals()
|
||||
|
|
@ -95,11 +99,21 @@ class TestCallableMixin:
|
|||
{"foo": 42, "spam": True, "baz": "fuz", "bar": "test"},
|
||||
{"foo": 42, "baz": "fuz", "bar": "test"},
|
||||
),
|
||||
pytest.param(
|
||||
functools.partial(callback2, bar="test"),
|
||||
{"foo": 42, "spam": True, "baz": "fuz"},
|
||||
{"foo": 42, "baz": "fuz"},
|
||||
),
|
||||
pytest.param(
|
||||
callback3,
|
||||
{"foo": 42, "spam": True, "baz": "fuz", "bar": "test"},
|
||||
{"foo": 42, "spam": True, "baz": "fuz", "bar": "test"},
|
||||
),
|
||||
pytest.param(
|
||||
callback4,
|
||||
{"foo": 42, "spam": True, "baz": "fuz", "bar": "test"},
|
||||
{"foo": 42, "baz": "fuz", "bar": "test"},
|
||||
),
|
||||
pytest.param(
|
||||
Filter(), {"foo": 42, "spam": True, "baz": "fuz"}, {"foo": 42, "baz": "fuz"}
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue