示例#1
0
    def test_cost_usage_source_is_reachable_no_bucket(self):
        """Verify that the cost usage source is not created when no bucket is provided."""
        authentication = {}
        bucket_name = None
        provider_interface = GCPLocalProvider()

        with self.assertRaises(ValidationError):
            provider_interface.cost_usage_source_is_reachable(
                authentication, bucket_name)
示例#2
0
    def test_cost_usage_source_is_reachable(self):
        """Verify that the file where local gcp ifles are stored is reachable."""
        authentication = {}
        bucket_name = '/tmp/path/to/bucket'

        provider = GCPLocalProvider()

        self.assertTrue(
            provider.cost_usage_source_is_reachable(authentication,
                                                    bucket_name))
示例#3
0
 def test_get_name(self):
     """Get name of provider."""
     provider = GCPLocalProvider()
     self.assertEqual(provider.name(), 'GCP-local')
示例#4
0
 def test_get_name(self):
     """Get name of provider."""
     provider = GCPLocalProvider()
     self.assertEqual(provider.name(), Provider.PROVIDER_GCP_LOCAL)