mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 10:11:52 +00:00
Removed the use of the context instance (Bot.get_current) from all placements that were used previously. (#1230)
* Removed the use of the context instance (Bot.get_current) from all placements that were used previously. * Fixed tests * Added changelog * Change category
This commit is contained in:
parent
479e302cba
commit
2ecf9cefd7
11 changed files with 45 additions and 49 deletions
|
|
@ -36,10 +36,9 @@ class TestChatActionSender:
|
|||
"upload_video_note",
|
||||
],
|
||||
)
|
||||
@pytest.mark.parametrize("pass_bot", [True, False])
|
||||
async def test_factory(self, action: str, bot: MockedBot, pass_bot: bool):
|
||||
async def test_factory(self, action: str, bot: MockedBot):
|
||||
sender_factory = getattr(ChatActionSender, action)
|
||||
sender = sender_factory(chat_id=42, bot=bot if pass_bot else None)
|
||||
sender = sender_factory(chat_id=42, bot=bot)
|
||||
assert isinstance(sender, ChatActionSender)
|
||||
assert sender.action == action
|
||||
assert sender.chat_id == 42
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue