mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Add test for MongoStorage for 100% coverage
This commit is contained in:
parent
fefbd45625
commit
4b23142bd5
1 changed files with 9 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue