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
pymongo_inmemory-0.1.1.tar.gz
(5.8 kB
view hashes)
Built Distribution
Close
Hashes for pymongo_inmemory-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 947acb9ce49d092dadfc5cf7c6197f12b6e9d00bd39506928ab4bca171cc9e1e |
|
MD5 | 75651b0def5b97f9cc817d56b5fb70b3 |
|
BLAKE2b-256 | 61f5cd11c907a2c61a9b1bfed7a2790c6328ebac6b377e14dd4b4acd8602789c |