Adding server test for get_secret_value
This commit is contained in:
parent
6e893ff055
commit
c4abd98ed3
27
tests/test_secretsmanager/test_server.py
Normal file
27
tests/test_secretsmanager/test_server.py
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
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-get-secret-value")
|
||||||
|
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['SecretId'] == "test"
|
Loading…
Reference in New Issue
Block a user