Reworked request builder

This commit is contained in:
Alex Root Junior 2023-03-11 04:09:57 +02:00
parent 6570d0bab1
commit 8a56258824
No known key found for this signature in database
GPG key ID: 074C1D455EBEA4AC
175 changed files with 582 additions and 1504 deletions

View file

@ -12,7 +12,7 @@ from aiogram.client.session import aiohttp
from aiogram.client.session.aiohttp import AiohttpSession
from aiogram.exceptions import TelegramNetworkError
from aiogram.methods import Request, TelegramMethod
from aiogram.types import UNSET, InputFile
from aiogram.types import UNSET_PARSE_MODE, InputFile
from tests.mocked_bot import MockedBot
@ -110,7 +110,7 @@ class TestAiohttpSession:
"str": "value",
"int": 42,
"bool": True,
"unset": UNSET,
"unset": UNSET_PARSE_MODE,
"null": None,
"list": ["foo"],
"dict": {"bar": "baz"},

View file

@ -24,7 +24,7 @@ from aiogram.exceptions import (
TelegramUnauthorizedError,
)
from aiogram.methods import DeleteMessage, GetMe, TelegramMethod
from aiogram.types import UNSET, User
from aiogram.types import UNSET_PARSE_MODE, User
from tests.mocked_bot import MockedBot
@ -33,7 +33,10 @@ class CustomSession(BaseSession):
pass
async def make_request(
self, token: str, method: TelegramMethod[TelegramType], timeout: Optional[int] = UNSET
self,
token: str,
method: TelegramMethod[TelegramType],
timeout: Optional[int] = UNSET_PARSE_MODE,
) -> None: # type: ignore
assert isinstance(token, str)
assert isinstance(method, TelegramMethod)