| 
									
										
										
										
											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="") | 
					
						
							| 
									
										
										
										
											2023-07-29 23:04:49 +00:00
										 |  |  |     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() | 
					
						
							| 
									
										
										
										
											2023-07-29 23:04:49 +00:00
										 |  |  |     assert len(resp["AdminAccounts"]) == 1 | 
					
						
							|  |  |  |     assert {"AdminAccountId": "someaccount", "AdminStatus": "ENABLED"} in resp[ | 
					
						
							|  |  |  |         "AdminAccounts" | 
					
						
							|  |  |  |     ] |