runner.mongodb

Module Contents

runner.mongodb.logger[source]
runner.mongodb.wait_for_mongodb(max_seconds: int = 20)[source]

With a freshly created container mongodb might need a bit of time to prime its files. This functions waits up to max_seconds seconds.

runner.mongodb.MONGODB_CLIENT[source]
runner.mongodb.ensure_mongodb(func)[source]

Decorator to raise an exception before running a function in case the mongodb server is not available.

runner.mongodb.list_databases() → List[dict][source]

List all existing databases

runner.mongodb.drop_database(database_name: str)[source]

Drop the selected database

runner.mongodb.copy_database(source_db_name: str, destination_db_name: str)[source]

Copy an existing database