fix API Gateway:create_usage_plan_key return wrong status code (#3134)
This commit is contained in:
parent
4e4ce5f9f1
commit
419f3fba5a
@ -528,13 +528,11 @@ class APIGatewayResponse(BaseResponse):
|
||||
error.message, error.error_type
|
||||
),
|
||||
)
|
||||
|
||||
return 201, {}, json.dumps(usage_plan_response)
|
||||
elif self.method == "GET":
|
||||
usage_plans_response = self.backend.get_usage_plan_keys(usage_plan_id)
|
||||
return 200, {}, json.dumps({"item": usage_plans_response})
|
||||
|
||||
return 200, {}, json.dumps(usage_plan_response)
|
||||
|
||||
def usage_plan_key_individual(self, request, full_url, headers):
|
||||
self.setup_class(request, full_url, headers)
|
||||
|
||||
|
@ -1989,6 +1989,7 @@ def test_usage_plan_keys():
|
||||
key_type = "API_KEY"
|
||||
payload = {"usagePlanId": usage_plan_id, "keyId": key_id, "keyType": key_type}
|
||||
response = client.create_usage_plan_key(**payload)
|
||||
response["ResponseMetadata"]["HTTPStatusCode"].should.equals(201)
|
||||
usage_plan_key_id = response["id"]
|
||||
|
||||
# Get current plan keys (expect 1)
|
||||
|
Loading…
Reference in New Issue
Block a user