Add unit test for add apigateway with policy
This commit is contained in:
parent
a658900d69
commit
0828c5af9d
@ -69,6 +69,24 @@ def test_create_rest_api_with_tags():
|
|||||||
response["tags"].should.equal({"MY_TAG1": "MY_VALUE1"})
|
response["tags"].should.equal({"MY_TAG1": "MY_VALUE1"})
|
||||||
|
|
||||||
|
|
||||||
|
@mock_apigateway
|
||||||
|
def test_create_rest_api_with_policy():
|
||||||
|
client = boto3.client("apigateway", region_name="us-west-2")
|
||||||
|
|
||||||
|
policy = "{\"Version\": \"2012-10-17\",\"Statement\": []}"
|
||||||
|
response = client.create_rest_api(
|
||||||
|
name="my_api",
|
||||||
|
description="this is my api",
|
||||||
|
policy=policy
|
||||||
|
)
|
||||||
|
api_id = response["id"]
|
||||||
|
|
||||||
|
response = client.get_rest_api(restApiId=api_id)
|
||||||
|
|
||||||
|
assert "policy" in response
|
||||||
|
response["policy"].should.equal(policy)
|
||||||
|
|
||||||
|
|
||||||
@mock_apigateway
|
@mock_apigateway
|
||||||
def test_create_rest_api_invalid_apikeysource():
|
def test_create_rest_api_invalid_apikeysource():
|
||||||
client = boto3.client("apigateway", region_name="us-west-2")
|
client = boto3.client("apigateway", region_name="us-west-2")
|
||||||
|
Loading…
Reference in New Issue
Block a user