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.21-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for mongomock_motor-0.0.21-py3-none-any.whl
Algorithm Hash digest
SHA256 f6f4a16d092d9b416ee91049eefd0dc97e9863677a5ef5308d67bc030d0820fc
MD5 3877f05d29f511a99d5509cc61131140
BLAKE2b-256 70a88a0203e1c6d4235dbc6f07b605b5fa0daceb08f8e0f8756740b779c759f0

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