def test_describe_account_exception(): client = boto3.client("organizations", region_name="us-east-1") with assert_raises(ClientError) as e: response = client.describe_account(AccountId=utils.make_random_account_id()) ex = e.exception ex.operation_name.should.equal("DescribeAccount") ex.response["Error"]["Code"].should.equal("400") ex.response["Error"]["Message"].should.contain("AccountNotFoundException")
def test_describe_account_exception(): client = boto3.client('organizations', region_name='us-east-1') with assert_raises(ClientError) as e: response = client.describe_account(AccountId=utils.make_random_account_id()) ex = e.exception ex.operation_name.should.equal('DescribeAccount') ex.response['Error']['Code'].should.equal('400') ex.response['Error']['Message'].should.contain('AccountNotFoundException')
def __init__(self, organization, **kwargs): self.organization_id = organization.id self.master_account_id = organization.master_account_id self.create_account_status_id = utils.make_random_create_account_status_id() self.id = utils.make_random_account_id() self.name = kwargs['AccountName'] self.email = kwargs['Email'] self.create_time = datetime.datetime.utcnow() self.status = 'ACTIVE' self.joined_method = 'CREATED' self.parent_id = organization.root_id
def __init__(self, organization, **kwargs): self.organization_id = organization.id self.master_account_id = organization.master_account_id self.create_account_status_id = utils.make_random_create_account_status_id( ) self.id = utils.make_random_account_id() self.name = kwargs['AccountName'] self.email = kwargs['Email'] self.create_time = datetime.datetime.utcnow() self.status = 'ACTIVE' self.joined_method = 'CREATED' self.parent_id = organization.root_id
def __init__(self, organization, **kwargs): self.type = "ACCOUNT" self.organization_id = organization.id self.master_account_id = organization.master_account_id self.create_account_status_id = utils.make_random_create_account_status_id( ) self.id = utils.make_random_account_id() self.name = kwargs["AccountName"] self.email = kwargs["Email"] self.create_time = datetime.datetime.utcnow() self.status = "ACTIVE" self.joined_method = "CREATED" self.parent_id = organization.root_id self.attached_policies = []
def test_make_random_account_id(): account_id = utils.make_random_account_id() account_id.should.match(utils.ACCOUNT_ID_REGEX)