Added "isTruncated" attribute for listUsersResponse (#4017)
* isTruncated attribute for listUsersResponse * correction and test
This commit is contained in:
parent
a95ca81e76
commit
e4057a34b9
@ -494,7 +494,7 @@ class IamResponse(BaseResponse):
|
|||||||
max_items = self._get_param("MaxItems")
|
max_items = self._get_param("MaxItems")
|
||||||
users = iam_backend.list_users(path_prefix, marker, max_items)
|
users = iam_backend.list_users(path_prefix, marker, max_items)
|
||||||
template = self.response_template(LIST_USERS_TEMPLATE)
|
template = self.response_template(LIST_USERS_TEMPLATE)
|
||||||
return template.render(action="List", users=users)
|
return template.render(action="List", users=users, isTruncated=False)
|
||||||
|
|
||||||
def update_user(self):
|
def update_user(self):
|
||||||
user_name = self._get_param("UserName")
|
user_name = self._get_param("UserName")
|
||||||
@ -1725,6 +1725,7 @@ USER_TEMPLATE = """<{{ action }}UserResponse>
|
|||||||
|
|
||||||
LIST_USERS_TEMPLATE = """<{{ action }}UsersResponse>
|
LIST_USERS_TEMPLATE = """<{{ action }}UsersResponse>
|
||||||
<{{ action }}UsersResult>
|
<{{ action }}UsersResult>
|
||||||
|
<IsTruncated>{{ isTruncated }}</IsTruncated>
|
||||||
<Users>
|
<Users>
|
||||||
{% for user in users %}
|
{% for user in users %}
|
||||||
<member>
|
<member>
|
||||||
|
@ -808,6 +808,7 @@ def test_list_users():
|
|||||||
user["UserName"].should.equal("my-user")
|
user["UserName"].should.equal("my-user")
|
||||||
user["Path"].should.equal("/")
|
user["Path"].should.equal("/")
|
||||||
user["Arn"].should.equal("arn:aws:iam::{}:user/my-user".format(ACCOUNT_ID))
|
user["Arn"].should.equal("arn:aws:iam::{}:user/my-user".format(ACCOUNT_ID))
|
||||||
|
response["IsTruncated"].should.equal(False)
|
||||||
|
|
||||||
conn.create_user(UserName="my-user-1", Path="myUser")
|
conn.create_user(UserName="my-user-1", Path="myUser")
|
||||||
response = conn.list_users(PathPrefix="my")
|
response = conn.list_users(PathPrefix="my")
|
||||||
|
Loading…
Reference in New Issue
Block a user