mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 02:03:04 +00:00
Bump Telegram Bot API version
Change request timeout mechanism Bump package version
This commit is contained in:
parent
b78f1cdb17
commit
7844a663a9
58 changed files with 526 additions and 369 deletions
|
|
@ -5,6 +5,7 @@ from aiogram import Bot
|
|||
from aiogram.api.client.session.base import BaseSession
|
||||
from aiogram.api.methods import TelegramMethod
|
||||
from aiogram.api.methods.base import Request, Response, T
|
||||
from aiogram.api.types import UNSET
|
||||
|
||||
|
||||
class MockedSession(BaseSession):
|
||||
|
|
@ -23,7 +24,9 @@ class MockedSession(BaseSession):
|
|||
async def close(self):
|
||||
pass
|
||||
|
||||
async def make_request(self, token: str, method: TelegramMethod[T]) -> T:
|
||||
async def make_request(
|
||||
self, token: str, method: TelegramMethod[T], timeout: Optional[int] = UNSET
|
||||
) -> T:
|
||||
self.requests.append(method.build_request())
|
||||
response: Response[T] = self.responses.pop()
|
||||
self.raise_for_status(response)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue