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

2022-05-27 10:28:08 +00:00
import boto3
from moto import mock_guardduty
@mock_guardduty
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
@mock_guardduty
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"
]