[3.x] Bot API 5.3 + Improvements (#618)

* Regenerate API

* Update code

* Fixed command filter for photos

* Fix tests so they are able to run

* Test new and renamed API methods

* Reformat files

* Fix outer_middleware resolution (#637) (#640)

* Fix outer_middleware resolution (#637)

* Reformat files

* Reorder routers when resolve middlewares

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>

* Added possibility to use empty callback data factory filter

* Rename KeyboardConstructor to KeyboardBuilder

* Fixed type

Co-authored-by: evgfilim1 <evgfilim1@yandex.ru>
This commit is contained in:
Alex Root Junior 2021-07-29 00:40:50 +03:00 committed by GitHub
parent 4599913e18
commit ac2b0bb198
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
69 changed files with 1223 additions and 206 deletions

View file

@ -1,7 +1,7 @@
import pytest
from aiogram.methods import GetChatMember, Request
from aiogram.types import ChatMember, User
from aiogram.types import ChatMember, ChatMemberOwner, User
from tests.mocked_bot import MockedBot
@ -11,7 +11,9 @@ class TestGetChatMember:
prepare_result = bot.add_result_for(
GetChatMember,
ok=True,
result=ChatMember(user=User(id=42, is_bot=False, first_name="User"), status="creator"),
result=ChatMemberOwner(
user=User(id=42, is_bot=False, first_name="User"), is_anonymous=False
),
)
response: ChatMember = await GetChatMember(chat_id=-42, user_id=42)
@ -24,7 +26,9 @@ class TestGetChatMember:
prepare_result = bot.add_result_for(
GetChatMember,
ok=True,
result=ChatMember(user=User(id=42, is_bot=False, first_name="User"), status="creator"),
result=ChatMemberOwner(
user=User(id=42, is_bot=False, first_name="User"), is_anonymous=False
),
)
response: ChatMember = await bot.get_chat_member(chat_id=-42, user_id=42)