moto/tests/test_secretsmanager/test_server.py
2018-06-09 23:42:33 -07:00

28 lines
711 B
Python

from __future__ import unicode_literals
import json
import sure # noqa
import moto.server as server
from moto import mock_secretsmanager
'''
Test the different server responses
'''
@mock_secretsmanager
def test_get_secret_value():
backend = server.create_backend_app("secretsmanager")
test_client = backend.test_client()
res = test_client.post('/',
data={"SecretId": "test", "VersionStage": "AWSCURRENT"},
headers={
"X-Amz-Target": "secretsmanager.GetSecretValue"},
)
json_data = json.loads(res.data.decode("utf-8"))
assert json_data['SecretString'] == "mysecretstring"