tests: removed docker-compose tests and moved instead to fakeredis and mongomock

This commit is contained in:
2025-02-10 17:54:27 +01:00
parent cce7712bb0
commit ca3f5f91b5
16 changed files with 1302 additions and 248 deletions

View File

@ -0,0 +1,29 @@
import os
def export_mongodb_data(host: str, port: int):
"""Export data from MongoDB to a JSON file."""
collections = [
"bec_access_profiles",
"deployment_access",
"deployment_credentials",
"deployments",
"fs.chunks",
"fs.files",
"scans",
"sessions",
"user_credentials",
"users",
]
current_dir = os.path.dirname(os.path.abspath(__file__))
for collection in collections:
os.system(
f"mongoexport --host {host} --port {port} --db bec_atlas --collection {collection} --jsonArray --out {current_dir}/test_data/bec_atlas.{collection}.json"
)
if __name__ == "__main__":
export_mongodb_data("localhost", 27017)