示例#1
0
 def test_cost_usage_source_is_reachable_no_access(self,
                                                   mock_get_sts_access):
     """Verify that the cost usage source is authenticated and created."""
     provider_interface = AWSProvider()
     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, mock_get_sts_access):
     """Verify that the cost usage source is authenticated and created."""
     provider_interface = AWSProvider()
     with self.assertRaises(ValidationError):
         credentials = {"role_arn": "arn:aws:s3:::my_s3_bucket"}
         data_source = {"bucket": None}
         provider_interface.cost_usage_source_is_reachable(credentials, data_source)
示例#3
0
 def test_cost_usage_source_is_reachable_no_arn(self):
     """Verify that the cost usage source is authenticated and created."""
     provider_interface = AWSProvider()
     with self.assertRaises(ValidationError):
         credentials = {"role_arn": None}
         data_source = {"bucket": "bucket_name"}
         provider_interface.cost_usage_source_is_reachable(credentials, data_source)
示例#4
0
 def test_cost_usage_source_is_reachable_no_topics(
         self, mock_get_sts_access, mock_check_s3_access,
         mock_check_cost_report_access):
     """Verify that the cost usage source is authenticated and created."""
     provider_interface = AWSProvider()
     try:
         provider_interface.cost_usage_source_is_reachable(
             'iam_arn', 'bucket_name')
     except Exception:
         self.fail('Unexpected Error')
示例#5
0
 def test_cost_usage_source_is_reachable_no_topics(
     self, mock_get_sts_access, mock_check_s3_access, mock_check_cost_report_access
 ):
     """Verify that the cost usage source is authenticated and created."""
     provider_interface = AWSProvider()
     try:
         credentials = {"role_arn": "arn:aws:s3:::my_s3_bucket"}
         data_source = {"bucket": "bucket_name"}
         provider_interface.cost_usage_source_is_reachable(credentials, data_source)
     except Exception:
         self.fail("Unexpected Error")
示例#6
0
 def test_get_name_aws(self):
     """Get name of aws service provider."""
     provider = AWSProvider()
     interface = ProviderAccessor(provider.name())
     self.assertEqual(provider.name(), interface.service_name())
示例#7
0
 def test_get_name(self):
     """Get name of provider."""
     provider = AWSProvider()
     self.assertEqual(provider.name(), 'AWS')
示例#8
0
 def test_cost_usage_source_is_reachable_no_arn(self):
     """Verify that the cost usage source is authenticated and created."""
     provider_interface = AWSProvider()
     with self.assertRaises(ValidationError):
         provider_interface.cost_usage_source_is_reachable(
             None, "bucket_name")