aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_secrets_manager.py
diff options
context:
space:
mode:
authorAlex Schofield <git@ajschof.me>2024-08-19 16:36:39 +0100
committerAlex Schofield <git@ajschof.me>2024-08-19 16:36:39 +0100
commit3e35364cc425db8738fb247a18f91c052c49fa8f (patch)
tree74e92dfff6a678d8a2ac62baa3cbf6d340ef23f1 /test/test_secrets_manager.py
parent105d9586249916f7baf9178d60411513f5f9e6f7 (diff)
downloadde-project-bentley-3e35364cc425db8738fb247a18f91c052c49fa8f.tar.gz
de-project-bentley-3e35364cc425db8738fb247a18f91c052c49fa8f.zip
chore: remove redundant test folder
Diffstat (limited to 'test/test_secrets_manager.py')
-rw-r--r--test/test_secrets_manager.py39
1 files changed, 0 insertions, 39 deletions
diff --git a/test/test_secrets_manager.py b/test/test_secrets_manager.py
deleted file mode 100644
index cb4ec15..0000000
--- a/test/test_secrets_manager.py
+++ /dev/null
@@ -1,39 +0,0 @@
-from src.secrets_manager import sm_client, create_secret, list_secret
-import boto3
-from moto import mock_aws
-import json
-import pytest
-import os
-
-pytest.fixture(scope="class")
-
-
-def mock_aws_credentials():
- """Mocked AWS Credentials for moto."""
- os.environ["AWS_ACCESS_KEY_ID"] = "testing"
- os.environ["AWS_SECRET_ACCESS_KEY"] = "testing"
- os.environ["AWS_SECURITY_TOKEN"] = "testing"
- os.environ["AWS_SESSION_TOKEN"] = "testing"
- os.environ["AWS_DEFAULT_REGION"] = "eu-west-2"
-
-
-@pytest.fixture(scope="class")
-def mock_sm_client(mock_aws_credentials):
- with mock_aws():
- yield boto3.client("secretsmanager")
-
-
-def test_create_secret_stores_secrets(mock_sm_client):
- cohort_id = "test_cohort_id"
- user = "test_user_id"
- password = "test_password"
- host = "test_host"
- database = "test_database"
- port = "test_port"
-
- secret_name = "test_secret"
- response = create_secret(
- mock_sm_client, secret_name, cohort_id, user, password, host, database, port
- )
-
- assert response["Name"] == secret_name
git.ajschof.me — hosted by ajschofield — powered by cgit