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
543 B
Python
Raw Permalink Normal View History

2017-09-07 18:21:44 +00:00
import boto3
2024-01-07 12:03:33 +00:00
from moto import mock_aws
2017-09-07 18:21:44 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws()
2017-09-07 18:21:44 +00:00
def test_account_aliases():
client = boto3.client("iam", region_name="us-east-1")
alias = "my-account-name"
aliases = client.list_account_aliases()
assert aliases["AccountAliases"] == []
2017-09-07 18:21:44 +00:00
client.create_account_alias(AccountAlias=alias)
aliases = client.list_account_aliases()
assert aliases["AccountAliases"] == [alias]
2017-09-07 18:21:44 +00:00
client.delete_account_alias(AccountAlias=alias)
aliases = client.list_account_aliases()
assert aliases["AccountAliases"] == []