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)
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)
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)))
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)}")