<filename>test/env_tools.py<gh_stars>1-10
"""Test environment variables module."""

from os import environ
from os.path import dirname, join


# File paths
_dir = dirname(__file__)
_db_path = join(_dir, "test_db.json")

# Main environment variables
environ["NL_SECRET_KEY"] = "1234"
environ["NL_ROOT_DOC"] = "0"

# +------------+
# | Unit tests |
# +------------+

# Local Storage environment variables
environ["NL_DB_SYS"] = "localst"
environ["NL_LOCALST_PATH"] = _db_path

# +----------------------------------------+
# | Unit tests + MongoDB integration tests |
# +----------------------------------------+

# Run a MongoDB Docker container:
#
# docker container run -d --name mongodb \
# -p 27017:27017 \
# -e MONGO_INITDB_ROOT_USERNAME=root \
# -e MONGO_INITDB_ROOT_PASSWORD=<PASSWORD> \
# mongo:5.0

# environ["NL_DB_SYS"] = "mongodb"
# environ["NL_MONGODB_URI"] = "mongodb://root:example@localhost:27017"
# environ["NL_MONGODB_DB"] = "notelist"
# environ["NL_MONGODB_US_COL"] = "users"
# environ["NL_MONGODB_NB_COL"] = "notebooks"
# environ["NL_MONGODB_NO_COL"] = "notes"
# environ["NL_MONGODB_BL_COL"] = "blocklist"

# +-----------------------------------------+
# | Unit tests + DynamoDB integration tests |
# +-----------------------------------------+

# Run a Local DynamoDB Docker container:
#
# docker container run -d --name dynamodb \
# -p 8000:8000 \
# amazon/dynamodb-local:1.17.0

# environ["NL_DB_SYS"] = "dynamodb"
# environ["NL_DYNAMODB_AWS_ENDPOINT"] = "http://localhost:8000"
# environ["NL_DYNAMODB_AWS_REGION"] = "eu-west-1"
# environ["NL_DYNAMODB_AWS_ACCESS_KEY_ID"] = "1234"      # Fake credential
# environ["NL_DYNAMODB_AWS_SECRET_ACCESS_KEY"] = "1234"  # Fake credential

# environ["NL_DYNAMODB_US_TAB"] = "notelist_users"
# environ["NL_DYNAMODB_NB_TAB"] = "notelist_notebooks"
# environ["NL_DYNAMODB_NO_TAB"] = "notelist_notes"
# environ["NL_DYNAMODB_BL_TAB"] = "notelist_blocklist"
