mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Define create_storage_key fixture in conftest.py
This commit is contained in:
parent
bbba6ce840
commit
369efee342
4 changed files with 10 additions and 20 deletions
|
|
@ -5,12 +5,6 @@ import pytest
|
|||
|
||||
from aiogram.fsm.storage.base import BaseEventIsolation, StorageKey
|
||||
from aiogram.fsm.storage.redis import RedisEventIsolation, RedisStorage
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
|
||||
@pytest.fixture(name="storage_key")
|
||||
def create_storage_key(bot: MockedBot):
|
||||
return StorageKey(chat_id=-42, user_id=42, bot_id=bot.id)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
|||
|
|
@ -2,16 +2,9 @@ import pytest
|
|||
|
||||
from aiogram.fsm.state import State
|
||||
from aiogram.fsm.storage.mongo import MongoStorage, StorageKey
|
||||
from tests.mocked_bot import MockedBot
|
||||
from tests.conftest import CHAT_ID, USER_ID
|
||||
|
||||
PREFIX = "fsm"
|
||||
CHAT_ID = -42
|
||||
USER_ID = 42
|
||||
|
||||
|
||||
@pytest.fixture(name="storage_key")
|
||||
def create_storage_key(bot: MockedBot):
|
||||
return StorageKey(chat_id=CHAT_ID, user_id=USER_ID, bot_id=bot.id)
|
||||
|
||||
|
||||
async def test_update_not_existing_data_with_empty_dictionary(
|
||||
|
|
|
|||
|
|
@ -1,12 +1,6 @@
|
|||
import pytest
|
||||
|
||||
from aiogram.fsm.storage.base import BaseStorage, StorageKey
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
|
||||
@pytest.fixture(name="storage_key")
|
||||
def create_storage_key(bot: MockedBot):
|
||||
return StorageKey(chat_id=-42, user_id=42, bot_id=bot.id)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue