Pymongo Mocking Tool with in memory MongoDB running.
Project description
pymongo_inmemory
A mongo mocking library with MongoDB running in memory.
Usage
Insert a new section to your projwects setup.cfg
for operating system and
mongo version:
[pymongo_inmemory]
mongo_version = 4.0
operating_system = osx
then use the in-memory client insstead of original one:
from pymongo_inmemory import MongoClient
client = MongoClient() # No need to provide host
db = client['testdb']
collection = db['test-collection']
# etc., etc.
client.close()
# Also usable with context manager
with MongoClient() as client:
# do stuff
TODO
- Move portfinding of Mongod to constructor to avoid possible port clashes between module load and object creation.
- Clean up and centralize config acquisition, env var>pim.ini>setup.cfg
- Add atexit register for mongod clean up
- Add module level docs where needed. Also function level docs for public API
- Add github docs, vuepress
- Ability to define folders through config (env overwrites)
- Wire ability to overwrite conf through env
- Increase test coverage
- Add static type checking
- Remove PIPE output from mongod
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pymongo_inmemory-0.1.1.tar.gz
.
File metadata
- Download URL: pymongo_inmemory-0.1.1.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
5f383193283e5d447ba7316f48260cf2a38465264aa4fd3939ea3ee95576fb04
|
|
MD5 |
5ec4a2955db8e2d7187c34c34422fbaf
|
|
BLAKE2b-256 |
0c095be2e7fdbd08004d2de62bdb25081f930adc8a9afe6b5c4568ac4bc2bc0f
|
File details
Details for the file pymongo_inmemory-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: pymongo_inmemory-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
947acb9ce49d092dadfc5cf7c6197f12b6e9d00bd39506928ab4bca171cc9e1e
|
|
MD5 |
75651b0def5b97f9cc817d56b5fb70b3
|
|
BLAKE2b-256 |
61f5cd11c907a2c61a9b1bfed7a2790c6328ebac6b377e14dd4b4acd8602789c
|