コード例 #1
0
    def test_cost_usage_source_is_reachable_no_bucket(self):
        """Verify that the cost usage source is not authenticated and created when no bucket is provided."""
        iam_arn = 'arn:aws:s3:::my_s3_bucket'
        bucket_name = None

        provider_interface = AWSLocalProvider()

        with self.assertRaises(ValidationError):
            provider_interface.cost_usage_source_is_reachable(iam_arn, bucket_name)
コード例 #2
0
    def test_cost_usage_source_is_reachable_no_bucket(self):
        """Verify that the cost usage source is not authenticated and created when no bucket is provided."""
        credentials = {"role_arn": "arn:aws:s3:::my_s3_bucket"}
        data_source = {"bucket": None}

        provider_interface = AWSLocalProvider()

        with self.assertRaises(ValidationError):
            provider_interface.cost_usage_source_is_reachable(credentials, data_source)
コード例 #3
0
    def test_cost_usage_source_is_reachable(self):
        """Verify that the cost usage source is authenticated and created."""
        iam_arn = 'arn:aws:s3:::my_s3_bucket'
        bucket_name = self.cur_source

        provider_interface = AWSLocalProvider()

        try:
            provider_interface.cost_usage_source_is_reachable(iam_arn, bucket_name)
        except Exception as error:
            self.fail('Unexpected Error: {}'.format(str(error)))
コード例 #4
0
    def test_cost_usage_source_is_reachable(self):
        """Verify that the cost usage source is authenticated and created."""
        credentials = {"role_arn": "arn:aws:s3:::my_s3_bucket"}
        data_source = {"bucket": self.cur_source}

        provider_interface = AWSLocalProvider()

        try:
            provider_interface.cost_usage_source_is_reachable(credentials, data_source)
        except Exception as error:
            self.fail(f"Unexpected Error: {str(error)}")