diff options
| author | bulve-ad <78788030+bulve-ad@users.noreply.github.com> | 2024-08-21 15:51:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-21 15:51:03 +0100 |
| commit | ce76bbb2b32b58a93d88db4abdb1bbfbf27243ea (patch) | |
| tree | b8e77c62b6a2d50ab04215beb54055d14210a423 /test | |
| parent | c8e94530b65d6807b2b9bb246a542963839cce9d (diff) | |
| parent | d01d3bed939d7a17ea2205af502baeeb35510b5c (diff) | |
| download | de-project-bentley-ce76bbb2b32b58a93d88db4abdb1bbfbf27243ea.tar.gz de-project-bentley-ce76bbb2b32b58a93d88db4abdb1bbfbf27243ea.zip | |
Merge branch 'development' into feature/transform_lambda
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_secrets_manager.py | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/test/test_secrets_manager.py b/test/test_secrets_manager.py deleted file mode 100644 index 86533bc..0000000 --- a/test/test_secrets_manager.py +++ /dev/null @@ -1,34 +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
\ No newline at end of file |
