Skip to main content

Library for mocking AsyncIOMotorClient built on top of mongomock.

Project description

mongomock-motor

PyPI version FOSSA Status

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

License

FOSSA Status

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

mongomock_motor-0.0.24-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file mongomock_motor-0.0.24-py3-none-any.whl.

File metadata

File hashes

Hashes for mongomock_motor-0.0.24-py3-none-any.whl
Algorithm Hash digest
SHA256 a65c7b59b3c7586d8ee228eae588549c8912468bade350a126d2c102f29086f8
MD5 3876ad7f555f4552cbb489733dafd330
BLAKE2b-256 de905bb9da5ca3d62a4d8daf9f6a79d799165caec19d6b44b87d7e318dcbe9b2

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page