Skip to content

Library for mocking AsyncIOMotorClient built on top of mongomock.

Notifications You must be signed in to change notification settings

Refty/mongomock_motor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mongomock-motor

PyPI version

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

About

Library for mocking AsyncIOMotorClient built on top of mongomock.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.5%
  • Makefile 2.5%