moto/tests/test_iam/test_iam_account_aliases.py
2021-10-18 19:44:29 +00:00

21 lines
665 B
Python

import boto3
import sure # pylint: disable=unused-import
from moto import mock_iam
@mock_iam()
def test_account_aliases():
client = boto3.client("iam", region_name="us-east-1")
alias = "my-account-name"
aliases = client.list_account_aliases()
aliases.should.have.key("AccountAliases").which.should.equal([])
client.create_account_alias(AccountAlias=alias)
aliases = client.list_account_aliases()
aliases.should.have.key("AccountAliases").which.should.equal([alias])
client.delete_account_alias(AccountAlias=alias)
aliases = client.list_account_aliases()
aliases.should.have.key("AccountAliases").which.should.equal([])