mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 18:19:34 +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():
|
def bot():
|
||||||
bot = MockedBot()
|
bot = MockedBot()
|
||||||
token = Bot.set_current(bot)
|
token = Bot.set_current(bot)
|
||||||
|
try:
|
||||||
yield bot
|
yield bot
|
||||||
|
finally:
|
||||||
Bot.reset_current(token)
|
Bot.reset_current(token)
|
||||||
bot.me.invalidate(bot)
|
bot.me.invalidate(bot)
|
||||||
|
|
|
||||||
|
|
@ -42,3 +42,7 @@ class TestStorages:
|
||||||
assert await storage.update_data(
|
assert await storage.update_data(
|
||||||
bot=bot, chat_id=-42, user_id=42, data={"baz": "spam"}
|
bot=bot, chat_id=-42, user_id=42, data={"baz": "spam"}
|
||||||
) == {"foo": "bar", "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