Skip to main content

Library for mocking AsyncIOMotorClient built on top of mongomock.

Project description

mongomock-motor

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

Project details


Download files

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

Source Distribution

mongomock_motor-0.0.1.dev0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

mongomock_motor-0.0.1.dev0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file mongomock_motor-0.0.1.dev0.tar.gz.

File metadata

  • Download URL: mongomock_motor-0.0.1.dev0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.7

File hashes

Hashes for mongomock_motor-0.0.1.dev0.tar.gz
Algorithm Hash digest
SHA256 c9e212b004bd5eaeabc3309c73604d95322f68db36ff7501c4ec650bf754bdfd
MD5 2b0c4d9d3836ec803dfd369376a9d2e2
BLAKE2b-256 8f664a079c456c0076e85dd1ec2ee3dad4d793cf977c8cd8d868094b46319454

See more details on using hashes here.

Provenance

File details

Details for the file mongomock_motor-0.0.1.dev0-py3-none-any.whl.

File metadata

  • Download URL: mongomock_motor-0.0.1.dev0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.7

File hashes

Hashes for mongomock_motor-0.0.1.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 bba6d63b017c164948ac5b5350799b77cc1c0b34fe00ea9b6e75de158d4aed46
MD5 3094acff4e8ad36fe359181b41b4e943
BLAKE2b-256 f0f37134c2e4179f0708c8e56c91587424cdd5459ccfc0eefd330604bdcc3caf

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