Adding response, urls and test

This commit is contained in:
zane 2018-06-07 22:31:44 -07:00
parent 99bbe6b86a
commit 6e893ff055
3 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,17 @@
from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from .models import secretsmanager_backends
class SecretsManagerResponse(BaseResponse):
def get_secret_value(self):
secret_id = self.get_param('SecretId')
version_id = self.get_param('VersionId')
version_stage = self.get_param('VersionStage')
return secretsmanager_backends[self.region].get_secret_value(
secret_id=secret_id,
version_id=version_id,
version_stage=version_stage)

View File

@ -0,0 +1,10 @@
from __future__ import unicode_literals
from .responses import SecretsManagerResponse
url_bases = [
"https?://secretsmanager.(.+).amazonaws.com",
]
url_paths = {
'{0}/$': SecretsManagerResponse.dispatch,
}

View File

@ -0,0 +1,13 @@
from __future__ import unicode_literals
import boto3
from moto import mock_secretsmanager
import sure # noqa
@mock_secretsmanager
def test_get_secret_value():
conn = boto3.client('secretsmanager', 'us-west-2')
result = conn.get_secret_value(SecretId='java-util-test-password')
assert result['SecretString'] == 'mysecretstring'