Update list IAM AccessKeys

Add the creation date, including timezone info, to the data returned
when requesting all AccessKeys for an IAM user.

This fixes #75
This commit is contained in:
graham-hargreaves 2017-05-07 16:02:53 +01:00
commit 835fe2d742
3 changed files with 8 additions and 5 deletions

View file

@ -299,6 +299,8 @@ def test_create_access_key():
@mock_iam_deprecated()
def test_get_all_access_keys():
"""If no access keys exist there should be none in the response,
if an access key is present it should have the correct fields present"""
conn = boto.connect_iam()
conn.create_user('my-user')
response = conn.get_all_access_keys('my-user')
@ -309,10 +311,10 @@ def test_get_all_access_keys():
)
conn.create_access_key('my-user')
response = conn.get_all_access_keys('my-user')
assert_not_equals(
response['list_access_keys_response'][
'list_access_keys_result']['access_key_metadata'],
[]
assert_equals(
sorted(response['list_access_keys_response'][
'list_access_keys_result']['access_key_metadata'][0].keys()),
sorted(['status', 'create_date', 'user_name', 'access_key_id'])
)