Implemented IAM delete_instance_profile (#3020)
* Implemented IAM delete_instance_profile * PR adjustment: positively verifying instance profile deletion in test case. Co-authored-by: Joseph Weitekamp <jweite@amazon.com>
This commit is contained in:
parent
4d3e3c8c5e
commit
4303123312
3 changed files with 42 additions and 0 deletions
|
|
@ -206,6 +206,26 @@ def test_remove_role_from_instance_profile():
|
|||
dict(profile.roles).should.be.empty
|
||||
|
||||
|
||||
@mock_iam()
|
||||
def test_delete_instance_profile():
|
||||
conn = boto3.client("iam", region_name="us-east-1")
|
||||
conn.create_role(
|
||||
RoleName="my-role", AssumeRolePolicyDocument="some policy", Path="/my-path/"
|
||||
)
|
||||
conn.create_instance_profile(InstanceProfileName="my-profile")
|
||||
conn.add_role_to_instance_profile(
|
||||
InstanceProfileName="my-profile", RoleName="my-role"
|
||||
)
|
||||
with assert_raises(conn.exceptions.DeleteConflictException):
|
||||
conn.delete_instance_profile(InstanceProfileName="my-profile")
|
||||
conn.remove_role_from_instance_profile(
|
||||
InstanceProfileName="my-profile", RoleName="my-role"
|
||||
)
|
||||
conn.delete_instance_profile(InstanceProfileName="my-profile")
|
||||
with assert_raises(conn.exceptions.NoSuchEntityException):
|
||||
profile = conn.get_instance_profile(InstanceProfileName="my-profile")
|
||||
|
||||
|
||||
@mock_iam()
|
||||
def test_get_login_profile():
|
||||
conn = boto3.client("iam", region_name="us-east-1")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue