From 7a88e634eb0e7780a07645faad5545ce2689531d Mon Sep 17 00:00:00 2001 From: Ashley Gould Date: Mon, 8 Oct 2018 15:27:19 -0700 Subject: [PATCH] organizations: add exception test for describe_organization endpoint --- tests/test_organizations/test_organizations_boto3.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_organizations/test_organizations_boto3.py b/tests/test_organizations/test_organizations_boto3.py index ae9bacd8270a..dfac5feeb294 100644 --- a/tests/test_organizations/test_organizations_boto3.py +++ b/tests/test_organizations/test_organizations_boto3.py @@ -32,6 +32,17 @@ def test_describe_organization(): validate_organization(response) +@mock_organizations +def test_describe_organization_exception(): + client = boto3.client('organizations', region_name='us-east-1') + with assert_raises(ClientError) as e: + response = client.describe_organization() + ex = e.exception + ex.operation_name.should.equal('DescribeOrganization') + ex.response['Error']['Code'].should.equal('400') + ex.response['Error']['Message'].should.contain('AWSOrganizationsNotInUseException') + + # Organizational Units @mock_organizations