Reworked request builder (#1142)

* Reworked request builder

* Added more default values

* Update tests

* Fixed timestamp

* Fixed Py3.8 support

* Describe changes
This commit is contained in:
Alex Root Junior 2023-03-11 20:46:36 +02:00 committed by GitHub
parent 924a83966d
commit fea1b7b0a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
300 changed files with 1003 additions and 3448 deletions

View file

@ -14,7 +14,7 @@ from aiogram import Bot
from aiogram.dispatcher.dispatcher import Dispatcher
from aiogram.dispatcher.event.bases import UNHANDLED, SkipHandler
from aiogram.dispatcher.router import Router
from aiogram.methods import GetMe, GetUpdates, Request, SendMessage
from aiogram.methods import GetMe, GetUpdates, Request, SendMessage, TelegramMethod
from aiogram.types import (
CallbackQuery,
Chat,
@ -775,9 +775,7 @@ class TestDispatcher:
dispatcher.message.register(simple_message_handler)
response = await dispatcher.feed_webhook_update(bot, RAW_UPDATE, _timeout=0.3)
assert isinstance(response, Request)
assert response.method == "sendMessage"
assert response.data["text"] == "ok"
assert isinstance(response, TelegramMethod)
async def test_feed_webhook_update_slow_process(self, bot: MockedBot, recwarn):
warnings.simplefilter("always")