moto/tests/test_guardduty/test_guardduty_organization.py

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

23 lines
697 B
Python
Raw Normal View History

2022-05-27 10:28:08 +00:00
import boto3
2024-01-07 12:03:33 +00:00
from moto import mock_aws
2022-05-27 10:28:08 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws
2022-05-27 10:28:08 +00:00
def test_enable_organization_admin_account():
client = boto3.client("guardduty", region_name="us-east-1")
resp = client.enable_organization_admin_account(AdminAccountId="")
assert resp["ResponseMetadata"]["HTTPStatusCode"] == 200
2022-05-27 10:28:08 +00:00
2024-01-07 12:03:33 +00:00
@mock_aws
2022-05-27 10:28:08 +00:00
def test_list_organization_admin_accounts():
client = boto3.client("guardduty", region_name="us-east-1")
client.enable_organization_admin_account(AdminAccountId="someaccount")
resp = client.list_organization_admin_accounts()
assert len(resp["AdminAccounts"]) == 1
assert {"AdminAccountId": "someaccount", "AdminStatus": "ENABLED"} in resp[
"AdminAccounts"
]