mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 02:03:04 +00:00
Small changes in tests
This commit is contained in:
parent
7f0a9d8097
commit
5296724a0f
2 changed files with 9 additions and 3 deletions
|
|
@ -63,6 +63,8 @@ async def memory_storage():
|
|||
def bot():
|
||||
bot = MockedBot()
|
||||
token = Bot.set_current(bot)
|
||||
yield bot
|
||||
Bot.reset_current(token)
|
||||
bot.me.invalidate(bot)
|
||||
try:
|
||||
yield bot
|
||||
finally:
|
||||
Bot.reset_current(token)
|
||||
bot.me.invalidate(bot)
|
||||
|
|
|
|||
|
|
@ -42,3 +42,7 @@ class TestStorages:
|
|||
assert await storage.update_data(
|
||||
bot=bot, chat_id=-42, user_id=42, data={"baz": "spam"}
|
||||
) == {"foo": "bar", "baz": "spam"}
|
||||
assert await storage.get_data(bot=bot, chat_id=-42, user_id=42) == {
|
||||
"foo": "bar",
|
||||
"baz": "spam",
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue