Adding response, urls and test
This commit is contained in:
parent
99bbe6b86a
commit
6e893ff055
17
moto/secretsmanager/responses.py
Normal file
17
moto/secretsmanager/responses.py
Normal 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)
|
10
moto/secretsmanager/urls.py
Normal file
10
moto/secretsmanager/urls.py
Normal 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,
|
||||
}
|
13
tests/test_secretsmanager/test_secretsmanager.py
Normal file
13
tests/test_secretsmanager/test_secretsmanager.py
Normal 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'
|
Loading…
Reference in New Issue
Block a user