Add test for MongoStorage for 100% coverage

This commit is contained in:
Rishat Fayzullin 2024-06-14 11:38:14 +03:00
parent fefbd45625
commit 4b23142bd5

View file

@ -1,3 +1,4 @@
from pymongo.errors import PyMongoError
import pytest
from aiogram.fsm.state import State
@ -7,6 +8,14 @@ from tests.conftest import CHAT_ID, USER_ID
PREFIX = "fsm"
async def test_get_storage_passing_only_url(mongo_server):
storage = MongoStorage.from_url(url=mongo_server)
try:
await storage._client.server_info()
except PyMongoError as e:
pytest.fail(str(e))
async def test_update_not_existing_data_with_empty_dictionary(
mongo_storage: MongoStorage,
storage_key: StorageKey,