added feature update_usage_plan and fixed some lint errors (#3727)

Co-authored-by: rajinder saini <rajinder.saini@c02vt5k2htd6.corp.climate.com>
This commit is contained in:
rajinder 2021-02-24 23:46:11 -08:00 committed by GitHub
commit 4b1c7225b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 64 additions and 11 deletions

View file

@ -2058,6 +2058,36 @@ def test_usage_plans():
len(response["items"]).should.equal(1)
@mock_apigateway
def test_update_usage_plan():
region_name = "us-west-2"
client = boto3.client("apigateway", region_name=region_name)
payload = {
"name": "TEST-PLAN-2",
"description": "Description",
"quota": {"limit": 10, "period": "DAY", "offset": 0},
"throttle": {"rateLimit": 2, "burstLimit": 1},
"apiStages": [{"apiId": "foo", "stage": "bar"}],
"tags": {"tag_key": "tag_value"},
}
response = client.create_usage_plan(**payload)
usage_plan_id = response["id"]
response = client.update_usage_plan(
usagePlanId=usage_plan_id,
patchOperations=[
{"op": "replace", "path": "/quota/limit", "value": "1000"},
{"op": "replace", "path": "/quota/period", "value": "MONTH"},
{"op": "replace", "path": "/throttle/rateLimit", "value": "500"},
{"op": "replace", "path": "/throttle/burstLimit", "value": "1500"},
],
)
response["quota"]["limit"].should.equal("1000")
response["quota"]["period"].should.equal("MONTH")
response["quota"]["limit"].should.equal("1000")
response["quota"]["limit"].should.equal("1000")
@mock_apigateway
def test_usage_plan_keys():
region_name = "us-west-2"