Reworked bot-wide defaults (#1392)

* Reworked defaults

* Added changelog and partial docs
This commit is contained in:
Alex Root Junior 2024-01-27 17:19:45 +02:00 committed by GitHub
parent 1281bf551a
commit 24f59da70d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
140 changed files with 608 additions and 530 deletions

View file

@ -12,6 +12,7 @@ from aiogram.client.session.aiohttp import AiohttpSession
from aiogram.client.telegram import TelegramAPIServer
from aiogram.methods import GetFile, GetMe
from aiogram.types import File, PhotoSize
from tests.deprecated import check_deprecated
from tests.mocked_bot import MockedBot
@ -41,6 +42,13 @@ class TestBot:
assert isinstance(bot.session, AiohttpSession)
assert bot.id == 42
def test_init_default(self):
with check_deprecated(
max_version="3.5.0",
exception=TypeError,
):
bot = Bot(token="42:Test", parse_mode="HTML")
def test_hashable(self):
bot = Bot("42:TEST")
assert hash(bot) == hash("42:TEST")