Fix ApiGateway key identification
API Gateway keys are identified by their ids and not their values - https://docs.aws.amazon.com/cli/latest/reference/apigateway/get-api-key.html#examples - http://boto3.readthedocs.io/en/latest/reference/services/apigateway.html#APIGateway.Client.get_api_key
This commit is contained in:
parent
0a4d2037df
commit
dcd290c3c3
2 changed files with 9 additions and 9 deletions
|
|
@ -976,22 +976,22 @@ def test_api_keys():
|
|||
apikey_name = 'TESTKEY1'
|
||||
payload = {'value': apikey_value, 'name': apikey_name}
|
||||
response = client.create_api_key(**payload)
|
||||
apikey = client.get_api_key(apiKey=payload['value'])
|
||||
apikey = client.get_api_key(apiKey=response['id'])
|
||||
apikey['name'].should.equal(apikey_name)
|
||||
apikey['value'].should.equal(apikey_value)
|
||||
|
||||
apikey_name = 'TESTKEY2'
|
||||
payload = {'name': apikey_name, 'generateDistinctId': True}
|
||||
response = client.create_api_key(**payload)
|
||||
apikey = client.get_api_key(apiKey=response['value'])
|
||||
apikey_id = response['id']
|
||||
apikey = client.get_api_key(apiKey=apikey_id)
|
||||
apikey['name'].should.equal(apikey_name)
|
||||
len(apikey['value']).should.equal(40)
|
||||
apikey_value = apikey['value']
|
||||
|
||||
response = client.get_api_keys()
|
||||
len(response['items']).should.equal(2)
|
||||
|
||||
client.delete_api_key(apiKey=apikey_value)
|
||||
client.delete_api_key(apiKey=apikey_id)
|
||||
|
||||
response = client.get_api_keys()
|
||||
len(response['items']).should.equal(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue