Library for mocking AsyncIOMotorClient built on top of mongomock.
Low maintenance activity. Last release 19 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases.
$
pip install mongomock-motormongomock-motor
Best effort mock for AsyncIOMotorClient (Database, Collection, e.t.c) built on top of mongomock library.
Example / Showcase
from mongomock_motor import AsyncMongoMockClient
async def test_mock_client():
collection = AsyncMongoMockClient()['tests']['test-1']
assert await collection.find({}).to_list(None) == []
result = await collection.insert_one({'a': 1})
assert result.inserted_id
assert len(await collection.find({}).to_list(None)) == 1