예제 #1
0
    def get_billing_source(self):
        """
        Return the billing source usage report source name.

        Args:
            None
        Returns:
            (String): "Identifier for cost usage report.  i.e. AWS: S3 Bucket",
                    example: "my-s3-cur-bucket"
        """
        obj = self._get_db_obj_query().first()
        billing_source_id = obj.billing_source_id
        billing_accessor = ProviderBillingSourceDBAccessor(billing_source_id)
        return billing_accessor.get_bucket()
 def test_get_provider_resource_name(self):
     """Test provider name getter."""
     billing_source_id = self.aws_billing_source.id
     accessor = ProviderBillingSourceDBAccessor(billing_source_id)
     self.assertEqual(self.aws_test_billing_source, accessor.get_bucket())
 def test_get_uuid(self):
     """Test uuid getter."""
     billing_source_id = self.aws_billing_source.id
     accessor = ProviderBillingSourceDBAccessor(billing_source_id)
     self.assertEqual(str(self.aws_billing_source.uuid),
                      accessor.get_uuid())
 def test_initializer(self):
     """Test Initializer."""
     billing_source_id = self.aws_billing_source.id
     accessor = ProviderBillingSourceDBAccessor(billing_source_id)
     self.assertTrue(accessor.does_db_entry_exist())