kaizendorks / pymongo_inmemory

A mongo mocking library with an ephemeral MongoDB running in memory.
MIT License
40 stars 13 forks source link

Issue #17 bug fix #22

Closed ekarademir closed 4 years ago

ekarademir commented 4 years ago

Fixes #17

Issue was originating from how we check the health status of running server. We were ignoring the connection string and querying uptime via mongo cli client directly, which was defaulting to port 27017 and localhost. So this was a very crucial bug :)

With this PR I've also added ability to run several servers in parallel by using a temp directory for data storage. Hence if previous process has not been cleaned up for some reason (which happens a lot, if python is terminated through debugger,) a new process can still be run.

I've also added two "example code" files, which are actually handy for integration testing. I'll create a ticket for using these and few more incoming for integration testing.