This commit is contained in:
@@ -8,6 +8,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
import minio
|
import minio
|
||||||
import pytest
|
import pytest
|
||||||
|
from dotenv import load_dotenv
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from pymongo import MongoClient
|
from pymongo import MongoClient
|
||||||
|
|
||||||
@@ -30,24 +31,15 @@ from shared.repositories.src.implementations import (
|
|||||||
# set random seed for reproducibility
|
# set random seed for reproducibility
|
||||||
random.seed(13)
|
random.seed(13)
|
||||||
|
|
||||||
# define test static variables
|
# load loca test environment variables
|
||||||
MINIO_PORT = 9000
|
test_env_path = Path(__file__).parent.parent.parent.parent.parent / 'test.env'
|
||||||
MINIO_ACCESS_KEY = 'minioadmin'
|
load_dotenv('test.env')
|
||||||
MINIO_SECRET_KEY = 'minioadmin'
|
|
||||||
MONGO_PORT = 27017
|
|
||||||
MONGO_USERNAME = 'admin'
|
|
||||||
MONGO_PASSWORD = 'password'
|
|
||||||
|
|
||||||
|
# define test environment variables
|
||||||
env_var_map = {
|
env_var_map = {
|
||||||
'MINIO_ENDPOINT': f'localhost:{MINIO_PORT}', # updated when container is running
|
|
||||||
'MINIO_ACCESS_KEY': MINIO_ACCESS_KEY,
|
|
||||||
'MINIO_SECRET_KEY': MINIO_SECRET_KEY,
|
|
||||||
'MINIO_BUCKET_NAME': 'test-bucket',
|
'MINIO_BUCKET_NAME': 'test-bucket',
|
||||||
'MINIO_OBJECT_NAME': 'test-object',
|
'MINIO_OBJECT_NAME': 'test-object',
|
||||||
'MINIO_IMAGE_NAME': 'test-image',
|
'MINIO_IMAGE_NAME': 'test-image',
|
||||||
'MONGO_ENDPOINT': (
|
|
||||||
f'mongodb://{MONGO_USERNAME}:{MONGO_PASSWORD}@localhost:{MONGO_PORT}/'
|
|
||||||
), # updated when container is running
|
|
||||||
'MONGO_DB': 'test-db',
|
'MONGO_DB': 'test-db',
|
||||||
'MONGO_COLLECTION': 'test-collection',
|
'MONGO_COLLECTION': 'test-collection',
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user