moto/tests/test_iam/test_iam_account_aliases.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
672 B
Python
Raw Normal View History

2017-09-07 18:21:44 +00:00
import boto3
import sure # noqa # pylint: disable=unused-import
2017-09-07 18:21:44 +00:00
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([])