Added "isTruncated" attribute for listUsersResponse (#4017)

* isTruncated attribute for listUsersResponse

* correction and test
This commit is contained in:
Cristopher Pinzón 2021-06-18 15:52:15 -05:00 committed by GitHub
parent a95ca81e76
commit e4057a34b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -494,7 +494,7 @@ class IamResponse(BaseResponse):
max_items = self._get_param("MaxItems")
users = iam_backend.list_users(path_prefix, marker, max_items)
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):
user_name = self._get_param("UserName")
@ -1725,6 +1725,7 @@ USER_TEMPLATE = """<{{ action }}UserResponse>
LIST_USERS_TEMPLATE = """<{{ action }}UsersResponse>
<{{ action }}UsersResult>
<IsTruncated>{{ isTruncated }}</IsTruncated>
<Users>
{% for user in users %}
<member>

View File

@ -808,6 +808,7 @@ def test_list_users():
user["UserName"].should.equal("my-user")
user["Path"].should.equal("/")
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")
response = conn.list_users(PathPrefix="my")