Add support for login profile deletion (#768)

* Add support for delete_login_profile.

Mock deletion of login profile. Set password to
none. Add tests to cover new endpoint.

* Fix typo in create_login_profile response.

Change CreateUserResult to CreateLoginProfileResult
in the CREATE_LOGIN_PROFILE_TEMPLATE. Caused KeyError
when using boto3.

Add test to cover boto3 in addition to boto.
This commit is contained in:
Sean Marlow 2016-11-11 15:05:02 -07:00 committed by Steve Pulec
commit fa3663c610
3 changed files with 40 additions and 2 deletions

View file

@ -604,6 +604,12 @@ class IAMBackend(BaseBackend):
raise IAMConflictException("User {0} already has password".format(user_name))
user.password = password
def delete_login_profile(self, user_name):
user = self.get_user(user_name)
if not user.password:
raise IAMNotFoundException("Login profile for {0} not found".format(user_name))
user.password = None
def add_user_to_group(self, group_name, user_name):
user = self.get_user(user_name)
group = self.get_group(group_name)